RTC_ESP32_NTP returns a byte with "GetYear"?

For general Flowcode discussion that does not belong in the other sections.
Post Reply
MJU20
Posts: 244
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

RTC_ESP32_NTP returns a byte with "GetYear"?

Post 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.

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: RTC_ESP32_NTP returns a byte with "GetYear"?

Post 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.

MJU20
Posts: 244
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: RTC_ESP32_NTP returns a byte with "GetYear"?

Post 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..

Post Reply