Skip to content

Difference 2.3.5 vs. 2.3.6 using Epoch32Time() #160

Answered by Makuna
parallyze asked this question in Q&A
Discussion options

You must be logged in to vote

time_t I believe is just a uint32_t; so anywhere below you could replace uint32_t with time_t and people were hitting it.

This line is incorrect

RtcDateTime tmp2 = Rtc.GetDateTime().Epoch32Time();

tmp2 was being constructed with the wrong time value, it takes a seconds from 2000/1/1. Epoch32Time is seconds since 1970/1/1.

Your assumption was a common issue that people were making.
Two issues were happening. Calling something like this...

uint32_t unixTime = Rtc.GetDateTime();

It doesn't return unix time so it was causing support issues and bugs in users code.
But, at the same time, they were also doing something like this which is what your statement really is doing...

RtcDateTime inter…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@parallyze
Comment options

Answer selected by Makuna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants