in reply to localtime hour count
Testing out your code, this is what happens. You subtracting the number of seconds from epoc for $t1 from the number of seconds from epoc for $2.
$t1 = 1000 $t2 = 1005 $sec_diff = $t2 - $t1; print "Time elapsed $sec_diff\n";
When you call localtime it returning a date time format for the seconds for epoc based upon the time for WHERE YOU ARE!
print "GMT time is " . gmtime($sec_diff); # Thu Jan 1 00:00:02 1970 print "Local time is " . localtime($sec_diff); # Thu Jan 1 19:00:02 1970 - for me at least.
Note: I realized someone else had mentioned the gmtime but I just wanted to explain it further.
|
|---|