I saw a post or two about how to get the local date & time with no easy answers. I need this myself for my first Arduino project so I had a look around and found a free API that does just this!
Although they also have a premium API, their free one is generous, allowing 1 request per second. I intend to only check it once or twice a day, myself. I should add that I found this through a 2-year-old post online where one person said it isn't reliable. I've only tested it a few times but so far, so good.
Info and how to sign up: https://timezonedb.com/
Sample URL: http://api.timezonedb.com/v2/get-time-zone?key=YOURAPIKEY&format=xml&by=zone&zone=America/Chicago
(Link will not work as it requires a working API key which I am not sharing.
Sample response:
Hope this helps someone!
Now a question for Erel or anyone else who would know:
I've read about the need to be efficient in B4R, so how would be the best way to process this response into something usable for updating our internal "clock" on the board?
Although they also have a premium API, their free one is generous, allowing 1 request per second. I intend to only check it once or twice a day, myself. I should add that I found this through a 2-year-old post online where one person said it isn't reliable. I've only tested it a few times but so far, so good.
Info and how to sign up: https://timezonedb.com/
Sample URL: http://api.timezonedb.com/v2/get-time-zone?key=YOURAPIKEY&format=xml&by=zone&zone=America/Chicago
(Link will not work as it requires a working API key which I am not sharing.
Sample response:
<result>
<status>OK</status>
<message/>
<countryCode>US</countryCode>
<countryName>United States</countryName>
<zoneName>America/Chicago</zoneName>
<abbreviation>CDT</abbreviation>
<gmtOffset>-18000</gmtOffset>
<dst>1</dst>
<dstStart>1520755200</dstStart>
<dstEnd>1541314799</dstEnd>
<nextAbbreviation>CST</nextAbbreviation>
<timestamp>1527884091</timestamp>
<formatted>2018-06-01 20:14:51</formatted>
</result>
Hope this helps someone!
Now a question for Erel or anyone else who would know:
I've read about the need to be efficient in B4R, so how would be the best way to process this response into something usable for updating our internal "clock" on the board?