M
Martin Trautmann
Hi all,
what's wrong about my interpretation of localtime?
perl -e '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time());
my $date =($year+1900)."-".
sprintf("%02d", $mon) ."-".
sprintf("%02d", $mday);
print $date;'
.... returns 2007-04-22 instead of 2007-05-22.
Do I need to increment the month count since Janury is counted as zero?
Thanks,
Martin
what's wrong about my interpretation of localtime?
perl -e '($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time());
my $date =($year+1900)."-".
sprintf("%02d", $mon) ."-".
sprintf("%02d", $mday);
print $date;'
.... returns 2007-04-22 instead of 2007-05-22.
Do I need to increment the month count since Janury is counted as zero?
Thanks,
Martin