Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

MicroPython • Re: Synchronize Pico W RTC to standard time

$
0
0
MicroPython itself has no understanding of time zones, doesn't have support for those in its time functions. 'localtime' is 'gmtime' and both are UTC. I have heard rumours that it will someday support time zones but don't know how that's progressing.

The best thing to do IMO is to let it do its thing and run on UTC then, when you want to display a local time, get the UTC, adjust to a notional local time, see if DST applies, and adjust further as required, display or use that.

It gets somewhat more complicated if you want to do more than that but you should be able to wrap it all in a library import and there may be some others have already written.

What do you want to do with the time as that may help point the best way to approach it ?

Statistics: Posted by hippy — Sat Apr 05, 2025 1:23 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles