Skip to content

NTP refresh after sleep skips timezone correction #189

@Kartoffel

Description

@Kartoffel

After a reset, I connect to WiFi and use wifi.ntp() to refresh the system time using NTP.

With the first call to time.localtime(), I get the correct time including timezone correction. However, when the app resumes from its own sleep and does wifi.ntp() again the time is off by an hour.

When I force an NTP update using wifi.ntp(onlyIfNeeded=False), the time is correct again. I suspect no timezone correction is performed when calling wifi.ntp() without arguments.

Use this app from the Hatchery to reproduce this. Sample output:

[time is 10:09]
[start app from the launcher]

Starting app 'timetest'...
10:9

[goes to sleep for 5 seconds]
[deepsleep reset]

BADGE.TEAM
Starting app 'timetest'...
9:9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions