I was wondering what would be the more convenient way to manage timezone after an getting and ntptime on my Pico W ?
In fact I’m not in UTC timezone, and I would like to avoid a fixed value to add to time. In fact, it’s difficult to compute dates where I should add 1 hour and other dates where it should be +2, depending on summer time.
Is there a specific library such as in Python to manage this ?
Many thanks !
On microcontrollers, you don’t usually use ntp. It is too complicated and requires specialized tables to convert to local time.
Easiest solution is to use timeapi.org. They provide a free (but unreliable service) to query your local time and return a json-structure which you can easily parse with python. If you have a small server (say a Raspberry Pi) running on your local LAN, you can run a similar time-server yourself (faster and more reliable).
Just let me know if you need additional information.
Thanks for your reply.
Indeed, I could use my Pi for this (another service for it …)
I will also give a look to timeapi.org, but if it’s unreliable …
:)