I’ve been trying for quite some time now to get my badger2040W’s clock app to work properly. Whenever I tried using that app, it was 5 hours ahead (I thought maybe that’s Sheffield time, but that’s 6 hours ahead of me), so I tried removing the code for the ntptime, but that would just always show 00:00:00 2001/1/1 when I opened it, so I put that code back in. I’m not sure what the problem is here. It could be Thonny setting the time incorrectly (there’s a commented line about that in the clock app), it could be ntptime setting it incorrectly, it could be the pico or pcf rtcs being set incorrectly. Is there something I can do other than writing something like “hours -= 5” in the code? (I tried using it not plugged into my computer to test if it was Thonny, and whenever I set the time using the B button it resets the time next time I open the app)
The fundamental problem is that ntp was written with computers in mind. Computers have a so called Olsen database which has all the rules to convert UTC to local time. Microcontrollers just don’t have enough space for things like this.
So you could write your own logic specific to your own location to convert UTC (this is what ntp gives you) to your local time. Or you could query a time-service that provides your local time. One such service is (was) worldtimeapi.org, but the service is very unreliable/unusable.
I wrote my own service running on a small Pi-system in my local network which provides the correct local time to all my microcontrollers. If you already have a local server, that is probably the easiest solution. Otherwise, I would go the route of using my own logic to convert UTC to local time.