in reply to Timegm and timelocal
Did I understand correct, that you are interested in just the difference?
Then, if your times are really at most 10 minutes apart, I don't think that you need to take care of the date or even the hour. Even if the daylight saving time occured between two timestamps. You just need to check the minutes and seconds. if the result is negative, just add 60 minutes and you should be okay.
Here a small example:
my $a="20070101005959"; my $z="20070101010101"; my $t1=substr($a,-4,2)*60+substr($a,-2); my $t2=substr($z,-4,2)*60+substr($z,-2); print (($t2+3600-$t1)%3600);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Timegm and timelocal
by Chon-Ji (Novice) on Jun 08, 2007 at 00:09 UTC | |
|
Re^2: Timegm and timelocal
by Chon-Ji (Novice) on Jun 08, 2007 at 00:33 UTC | |
by Skeeve (Parson) on Jun 08, 2007 at 10:56 UTC |