shell: rtc: fix off by one

This commit is contained in:
S.J.R. van Schaik 2017-07-27 12:25:57 +02:00
parent 2b1d401296
commit db0a62fc9f

View file

@ -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;