M
mhearne808[insert-at-sign-here]gmail[insert-dot-he
I think have a fundamental misunderstanding of one of either
localtime() or mktime(). Here's a snippet of code that illustrates
what I find confusing:
#############################
use Time::Local;
use POSIX;
$unixtime4 = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($unixtime4);
$unixtime5 = mktime($sec,$min,$hour,$mday,$mon,$year);
print STDERR "Time4: $unixtime4\n";
print STDERR "Time5: $unixtime5\n";
#############################
I would expect that $unixtime4 and $unixtime5 would be identical -
however, they are different by exactly 1 hour (on Mac OS X and Linux
RHEL).
Can anyone explain to me why this is?
--Mike
localtime() or mktime(). Here's a snippet of code that illustrates
what I find confusing:
#############################
use Time::Local;
use POSIX;
$unixtime4 = time();
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($unixtime4);
$unixtime5 = mktime($sec,$min,$hour,$mday,$mon,$year);
print STDERR "Time4: $unixtime4\n";
print STDERR "Time5: $unixtime5\n";
#############################
I would expect that $unixtime4 and $unixtime5 would be identical -
however, they are different by exactly 1 hour (on Mac OS X and Linux
RHEL).
Can anyone explain to me why this is?
--Mike