Hi.
I has used this lib for my timezone before https://github.com/mamuesp/timezones
. Now tz still sync correctly to UTC I expected. but when I print local time it wrong
time_t t = time(NULL);
struct tm tm = *localtime(&t);
uint16_t year = tm.tm_year + 1900;
LOG(LL_WARN, ("##Year : %d",tm.tm_year + 1900));
LOG(LL_WARN, ("##Month: %02d",tm.tm_mon + 1));
LOG(LL_WARN, ("##Day : %02d",tm.tm_mday));
LOG(LL_WARN, ("##Hour : %02d",tm.tm_hour));
LOG(LL_WARN, ("##Min : %02d",tm.tm_min));
LOG(LL_WARN, ("##Sec : %02d",tm.tm_sec));
This is like 15hour behind the real time here.
[Dec 21 03:16:49.487] main.cpp:386 ##Year : 2022
[Dec 21 03:16:49.487] main.cpp:387 ##Month: 12
[Dec 21 03:16:49.492] main.cpp:388 ##Day : 20
[Dec 21 03:16:49.492] main.cpp:389 ##Hour : 12
[Dec 21 03:16:49.497] main.cpp:390 ##Min : 16
[Dec 21 03:16:49.497] main.cpp:391 ##Sec : 50
This that about time api or something ? I used to work before