add: weekday support and fix start value of day and month - 1

This commit is contained in:
2024-09-18 21:55:49 +02:00
parent ef75ad874d
commit 083468240d
3 changed files with 14 additions and 3 deletions

View File

@ -16,7 +16,15 @@ void date()
"October",
"November",
"December" };
static const char * week_days[] = {
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday" };
struct rtc_date date = get_date();
kprintf(0, "%s. %d %s. %d %d:%d:%d\n", "mer", date.day, months[date.month], date.year, date.hour, date.minute, date.second);
kprintf(0, "%s. %d %s. %d %d:%d:%d\n", week_days[date.index_of_the_day], date.day, months[date.month], date.year, date.hour, date.minute, date.second);
}