"ArduinoIoTCloudTCP::handle_SyncTime could not get valid time" caused by timezone diffrence #506
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
If the user's timezone is higher than UTC (ex. UTC+4) than if the code is compiled at
22.00 UTC
,EPOCH_AT_COMPILE_TIME
will return a value higher than the current epoch becausecvt_time(__DATE__)
returns the date according to the user's local timezone.This means that code compiled at
23.00 UTC
will not function for timezonesUTC+1
and higher.according to wiki the biggest offset is
UTC+14
so decreasing50400
(14 * 60 * 60) would work:ArduinoIoTCloud/src/utility/time/TimeService.cpp line 97
or
ArduinoIoTCloud/src/utility/time/TimeService.cpp line 323
This may not be the best solution but is one nevertheless.
I can open a simple PR for this if it is ok for you guys.
The text was updated successfully, but these errors were encountered: