![Smile :)](./images/smilies/icon_e_smile.gif)
Been tinkering with getting time from Internet lately for my Pi Pico, and found a little curiosity....
One of the four MCU's differs in it's origin of Epoch...???
I tested these via Thonny IDE, with it's auto time sync off (sync_time = False) cold boot and no external RTC.
This is the format of the 8-tuple ( Year, Month, Day, DayOfWeek, Hour, Minute, Second, Sub Second ). I'm unsure
what the Sub Sec measure is (uS?).
Day of week by ISO 8601 standard starts on Monday and ends on Sunday, both the ESP32 and ESP8266 show a
week day no of '5' by ISO standard that's a Friday but the 1st January 2000 was Saturday. The Teensy 4.0 shows
a week day no of '3' by modern standard that's a Wednesday but the 1st of January 1970 was a Thursday, tho the
ISO 8601 standard didn't exist then....
The reason of Pi Pico Epoch is unclear, but it's Day of Week no '4' that's a Thursday, 1st of January this year was a Friday...
Got insight to Unix-Time and ISO 8601 standard from Wikipedia...
Curious...
Code: Select all
==================================
MicroPython v1.17 on 2021-09-02; ESP module with ESP8266
Type "help()" for more information.
>>> from machine import RTC
>>> rtc = RTC()
>>> rtc.datetime()
(2000, 1, 1, 5, 0, 0, 53, 636) <<< Known Epoch used by MCU's and MicroPython >>>
>>>
==================================
MicroPython v1.17 on 2021-09-02; ESP32 module with ESP32
Type "help()" for more information.
>>> from machine import RTC
>>> rtc = RTC()
>>> rtc.datetime()
(2000, 1, 1, 5, 0, 1, 8, 876935) <<< Known Epoch used by MCU's and MicroPython >>>
>>>
==================================
MicroPython v1.17-138-gff4f1f3ab-dirty on 2021-11-10; Teensy 4.0 with MIMXRT1062DVJ6A
Type "help()" for more information.
>>> from machine import RTC
>>> rtc = RTC()
>>> rtc.datetime()
(1970, 1, 1, 3, 0, 1, 26, 325013) <<< Known Epoch used by Unix/Linux >>>
>>>
==================================
MicroPython v1.17 on 2021-09-02; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> from machine import RTC
>>> rtc = RTC()
>>> rtc.datetime()
(2021, 1, 1, 4, 0, 1, 23, 0) <<< Unknown Epoch ???? >>>
>>>
==================================