From db0a62fc9f98527740b017a1e72539f3b2211e28 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Thu, 27 Jul 2017 12:25:57 +0200 Subject: [PATCH] shell: rtc: fix off by one --- source/shell/rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/shell/rtc.c b/source/shell/rtc.c index 20b3362..7bff2b5 100644 --- a/source/shell/rtc.c +++ b/source/shell/rtc.c @@ -16,7 +16,7 @@ int shell_date(struct console *con, size_t argc, const char **argv) rtc_get_time(&now); fprintf(con->fp, "%02d:%02d:%02d %02d-%02d-%d\n", - now.tm_hour, now.tm_min, now.tm_sec, + now.tm_hour + 1, now.tm_min, now.tm_sec, now.tm_mday, now.tm_mon + 1, now.tm_year + 1900); return 0; @@ -55,7 +55,7 @@ int shell_set_date(struct console *con, size_t argc, const char **argv) rtc_init(&now); fprintf(con->fp, "%02d:%02d:%02d %02d-%02d-%d\n", - now.tm_hour, now.tm_min, now.tm_sec, + now.tm_hour + 1, now.tm_min, now.tm_sec, now.tm_mday, now.tm_mon + 1, now.tm_year + 1900); return 0;