diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 2f01bb636bf..975203ae4f9 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -868,7 +868,7 @@ Dictionary _OS::get_datetime_from_unix_time(int64_t unix_time_val) const { } else { dayno = (unix_time_val - SECS_DAY + 1) / SECS_DAY; dayclock = unix_time_val - dayno * SECS_DAY; - date.weekday = static_cast((dayno - 3) % 7 + 7); + date.weekday = static_cast(((dayno % 7) + 11) % 7); do { year--; dayno += YEARSIZE(year);