Jeff 'japhy' Pinyan wrote:
Well, if you subtract 86400 seconds from the current time to
*attempt* to get the same time a day earlier, you might sometimes
fail, such as at 11:55pm on the day that daylight savings time
ended.  If you subtract 86400 seconds (24 hours), you will NOT be
at 11:55pm on the previous day, but rather at 12:55am of the same
day, because there was an extra hour in the day.

One way to address that issue might be to switch from localtime() to gmtime(). That's what I'm actually doing in a couple of own programs where I subtract 86400 seconds in order to get the previous day.

Otherwise you'd better decide whether you can live with the
shortcoming you called our attention to... ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to