Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d1fc512

Browse files
committedAug 23, 2024··
fix time validity check
1 parent 9166399 commit d1fc512

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/utility/time/TimeService.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,9 @@ unsigned long TimeServiceClass::getRemoteTime()
320320

321321
bool TimeServiceClass::isTimeValid(unsigned long const time)
322322
{
323-
return (time > EPOCH_AT_COMPILE_TIME);
323+
// EPOCH_AT_COMPILE_TIME is in local time,
324+
// so we need to subtract the maximum possible timezone offset to make sure we are less then utc time
325+
return (time > (EPOCH_AT_COMPILE_TIME - (/*UTC+14*/ 14 * 60 * 60)));
324326
}
325327

326328
bool TimeServiceClass::isTimeZoneOffsetValid(long const offset)

0 commit comments

Comments
 (0)
Please sign in to comment.