shell: rtc: fix off by one

tags/0.1.0
S.J.R. van Schaik 7 years ago
parent 66f0b7b0d6
commit fc61b55493
  1. 4
      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 + 1, now.tm_min, now.tm_sec,
now.tm_hour, 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 + 1, now.tm_min, now.tm_sec,
now.tm_hour, now.tm_min, now.tm_sec,
now.tm_mday, now.tm_mon + 1, now.tm_year + 1900);
return 0;

Loading…
Cancel
Save