Tag:localtime

  • 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 […]

  • Introduction to the Application of Perl Localtime Time Function

    Time:2019-9-1

    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 time in the database, you can save it as a string first, and then read the string before processing. @nowtime=localtime();$nowstring=join(‘,’,@nowtime);Save $nowstring;Read:@nowtime=split(‘,’,$nowstring); For more information, see http://perldoc.perl.org/functions/localtime.html