Today I find following perl script running incorrect. Current actual datetime is 20140814 13:19 But it returns: 2014-7-14-13-19-15 (the month value 7 is 1 less than actual value 8)
MY OS: win7
sub GetFileNameDate {
my ($sec,$min,$hour,$day,$month,$yr19,@rest) = localtime;
return sprintf "%s-%s-%s-%02d-%02d-%02d", ($yr19 + 1900), $month, $day, $hour, $min, $sec;
}
See Question&Answers more detail:os