Detect Daylight Saving Time

Submitted by:Pitter Alderson

Date added:22 June, 2014

Category:MySQL

To test in other timezones, replace '-5' with your local standard time GMT offset.

Tags: daylight saving , detect time

Code Snippet:

SELECT -5 - CAST(REPLACE(TIMEDIFF(NOW(), 
UTC_TIMESTAMP()), ':00:00', '') AS SIGNED) AS isDst
 
 

Comments