-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Hi,
the NTP_DELTA values for the different epochs seem the wrong way around.
The following happens on my ESP32:
import ntptime, utime
print(utime.gmtime(0)[0])
print(ntptime.time())2000
757785416
This timestamp is sometime in 1994.
If I switch the deltas around I get the correct timestamp from ntptime.
2000
1704471142
if EPOCH_YEAR == 2000:
# (date(2000, 1, 1) - date(1900, 1, 1)).days * 24*60*60
#old NTP_DELTA = 3155673600
NTP_DELTA = 2208988800
elif EPOCH_YEAR == 1970:
# (date(1970, 1, 1) - date(1900, 1, 1)).days * 24*60*60
#old NTP_DELTA = 2208988800
NTP_DELTA = 3155673600But this doesn't make sense intuitively... Somehow 1970-1900 needs to be bigger than 2000-1900.
Maybe something about the port is off? I'm running
MicroPython infos: (sysname='esp32', nodename='esp32', release='1.22.0', version='v1.22.0 on 2023-12-27', machine='Generic ESP32 module with ESP32')
on a ESP-32-Wroom-32 from AZ-Delivery.
Any tips are appreciated.
Metadata
Metadata
Assignees
Labels
No labels