Page 1 of 1

RTC_ESP32_NTP returns a byte with "GetYear"?

Posted: Sat Mar 23, 2024 11:40 pm
by MJU20
RTC_ESP32_NTP returns a byte with "GetYear"... https://www.flowcode.co.uk/wiki/index.p ... k)#GetYear

Isn't that odd? The NTP protocol returns a 4 digit for the year.
Off course there is no way that the NTP will return a number in the past, but for certain calculations (like the weekday) the whole year is necessary.

Re: RTC_ESP32_NTP returns a byte with "GetYear"?

Posted: Mon Mar 25, 2024 4:06 pm
by BenR
Hello,

It seems to be buried in the time library for the ESP IDF. I've had a quick dig in to try and find out more but haven't made much progress. Looks to be being truncated to 2 digits somewhere.

Re: RTC_ESP32_NTP returns a byte with "GetYear"?

Posted: Mon Mar 25, 2024 5:17 pm
by MJU20
Thanks BenR,

Some things didn't work until I found out why.
It was because the macro returns a byte.

Maybe this could solve issues other users have..