shell: rtc: fix off by one

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 2b1d401296
commit db0a62fc9f
  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, 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;

Loading…
Cancel
Save