This PR changes the type of seconds_since_midnight and the explicit cast of curr_date_time. the previous implementation casted curr_date_time, which is a time_t value (64bit value), to unsigned int and took the mod. However, casting 64bit value to 32bit value (uint) will result in loosing upper 32 bits, and thus will result in the value wrapping around (btw, the exact year time_t value will wrap around in unsigned int is year 2106).
To prevent this, curr_date_time should be casted to u64 type.
This PR changes the type of
seconds_since_midnight
and the explicit cast ofcurr_date_time
. the previous implementation castedcurr_date_time
, which is atime_t
value (64bit value), tounsigned int
and took the mod. However, casting 64bit value to 32bit value (uint) will result in loosing upper 32 bits, and thus will result in the value wrapping around (btw, the exact year time_t value will wrap around in unsigned int is year 2106). To prevent this,curr_date_time
should be casted to u64 type.Thanks in advance for your consideration.