Hi, I'm trying to display the current time and date...
If I do this:
I get this:
Time is: 1220390156
108-8-2-21:15:56
2008-09-02-21.15.56
Why am I getting month 8 in the second line? Isn't today september?
If I do this:
Code:
#!/usr/bin/perl
use POSIX;
print "Time is: ";
$test = time();
print "$test\n";
($sec,$min,$hour,$mday,$month,$year) = gmtime($test);
print "$year-$month-$mday-$hour:$min:$sec\n";
print strftime "%Y-%m-%d-%H.%M.%S\n", gmtime;
I get this:
Time is: 1220390156
108-8-2-21:15:56
2008-09-02-21.15.56
Why am I getting month 8 in the second line? Isn't today september?