Daylight saving time calculation in SPIN ?
smbaker
Posts: 164
in Propeller 1
Does anyone have a spin implementation of US daylight saving time calculation? I'm looking for something that given a year, month, and day will tell me whether DST is in effect. I suppose if need be, I could just include a static table of known DST dates, but I was hoping there's something cleverer.
Thanks,
Scott
Thanks,
Scott
Comments
It ends on this date in November:
So, in 2017, DST began on the 14 - (1 + 2017 * 5 / 4) // 7 == 12th of March.
It ends on the 7 - (1 + 2017 * 5 / 4) // 7 == 5th of November.
Here's where I got it: http://ask.metafilter.com/107559/Magical-DST-Formula-or-just-funky-math
The rest of your calculations should be easy from there.
-Phil
I can now close out that ticket the wife submitted about incorrect clocks!
Scott