robtillaart:
Very usefull as there are many questions about getting the time zone right (after I had written an NTP-RTC article on the playground).I am wondering about the DST algorithm, does it include Europe? did not dive into the code yet
Hi Rob, yes it should work for Europe, see the "WorldClock" example supplied with the library. The examples should work right out of the box on a bare Arduino. Glad to have you kick the tires, let me know if you find issues!
Should also work in the Southern hemisphere, I knew Nick would never let me live it down otherwise
The algorithm works from rules that you supply. For example, US Eastern Daylight Time, which has a UTC offset of -240 minutes, starts on the 2nd Sunday in March at 02:00 local time. So the rules are coded, in pairs, like this:
TimeChangeRule usEdt = {"EDT", Second, Sun, Mar, 2, -240};Â Â //UTC - 4 hours
TimeChangeRule usEst = {"EST", First, Sun, Nov, 2, -300};Â Â //UTC - 5 hours
I was pulling my hair out at one point during testing but discovered I had the rules wrong!