Application introduction of Perl Localtime function

Time:2022-5-2

1. General use:

@nowtime=localtime();
#($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
be careful:
$mon+1,$year+1900;
$now_string = localtime;  # e.g., “Thu Oct 13 04:54:34 1994”

2. If you want to save the time in the database, you can first save it as a string, and then process the string when reading it.

@nowtime=localtime();
$nowstring=join(‘,’,@nowtime);
Save $nowstring;
Read:
@nowtime=split(‘,’,$nowstring);

For more information, please refer to: http://perldoc.perl.org/functions/localtime.html

Recommended Today

In the digital age, what can replace the KFC site selection book?

"The KFC site selection experience was once regarded as a treasure book in the industry. Now that the business environment is more complex and volatile, what is a more effective winning tool in the digital age?"   Under the impact of the epidemic, the catering industry is undergoing restructuring, half of which is sea water […]