Telling if a given datetime is within the DST switchover

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anyone have a method or function for telling if a datetime is
within the DST switchover based on the time zone?

For example, if the script were running in England, a datetime of
March 29 2015 01:30 would return True. If it were running in NY, March
8 2015 02:30 would return True. I'm looking for something that would
work for any time zone and for any year.

The use case is that I have a server uptime reporting script and it
uses a database of times that the server was able to be pinged. If
there is no entry for a period it indicated the server was down. So on
March 29, running in London, it found no entries from 1am to 2am and
it reported the server was down for an hour, when in fact the period
from 1am to 2am did not exist because of the switch to summer time.

TIA!
-larry

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux