This commit is contained in:
Willy-JL
2024-03-12 04:35:14 +00:00
20 changed files with 294 additions and 251 deletions
+1
View File
@@ -71,6 +71,7 @@ void datetime_timestamp_to_datetime(uint32_t timestamp, DateTime* datetime) {
uint32_t seconds_in_day = timestamp % SECONDS_PER_DAY;
datetime->year = EPOCH_START_YEAR;
datetime->weekday = ((days + 3) % 7) + 1;
while(days >= datetime_get_days_per_year(datetime->year)) {
days -= datetime_get_days_per_year(datetime->year);