Daylight Saving Time begins at 2 a.m. on the first Sunday of April Daylight Saving Time ends at 2 a.m. on the last Sunday of October. The second Sunday in March will always be between the 8th and the 14th inclusive. I have a clock manufactured pre-2007 that automatically adjusts for daylight savings time, and now I have to change it four times a year: twice when the actual change occurs, and twice when it now-incorrectly changes itself at the old dates. And if even that is too difficult, at least give the user the option to turn off automatic adjustments (unlike my stupid alarm clock). DST test reference is via this article as answered by captncraig and my own reasoning and interpretation of his answer. That database is several orders of magnitude larger than my available memory without hardware expansion. The hard part is determining whether I am in daylight saving time or not, because it changes from year to year. If you can't do that for some reason, at least allow the user to override the rules. Also, you might want to format your last code snippet so it's vaguely readable. Or you could do like most consumer devices and let the user adjust the time to the local time zone twice a year. There doesn't appear to be any comprehensive date libraries for my platform, and I feel like that would be overkill anyway. + 1 - DATEPART(w, CAST('3/14/' + CAST(DATEPART(yyyy, [date2check]) AS nvarchar(4)) AS datetime))) THEN dateadd(hh, - DST_GMT_TM_ZN_DIFF, Mind sharing your opinions on how to proceed next? I wrote a quick unit test and verified that this code agrees with TimeZone.IsDayLightSavingsTime() for all dates from 1800 to 2200. Daylight savings time didn't even exist at a national level in the US until 1966 (except for certain periods during the two World Wars). What are China's Interests in the Arctic? I think you may have an off-by-one in one of your checks. But if you really need to handle DST and really want to do things right, use the zoneinfo database and make sure it can be updated somehow. I did not account for the 2 am rule, but you could easily do that check if the day of week is Sunday and the date is between 8 and 14 (in March) or 1 and 7 (in November). Temperature change in Earth atmosphere models? it then adds 2 hours to this date to get the time in which the daylight savings actually occur. if (month==11 && day>=1 && day <=7 && DoW=1) return True. AS datetime))) THEN dateadd(hh, - STD_GMT_TM_ZN_DIFF, [date2check]) ELSE dateadd(hh, - DST_GMT_TM_ZN_DIFF, How practical are clipless pedal shoes on a long bike tour? Please add some text describing what is going on here. Stack Overflow for Teams is a private, secure spot for you and There are a few facts that will help us: These facts lead to the following code (C#, but trivially portable to your platform): It turns out you don't even need to know the year to do this, as long as you can trust your day of the week value. It is assumed that the years are between 2000 and 2099 inclusive. How to store repeating dates keeping in mind Daylight Savings Time, Daylight Saving Time change schedule trigger for a marginal time, Daylight Saving Time change with an absolute date, Date time convertion with daylight saving. Is youtube-dl takedown due to their tests which use copyrighted content? March 14th and November 7 are always part of the week that the day light savings occur in the united states.. they may be the Sunday or the Saturday or and day of the week in-between but they are always part of that week.