Lines Matching +full:reset +full:- +full:time +full:- +full:sec
1 // SPDX-License-Identifier: GPL-2.0+
8 * RTC, Date & Time support: get and set date & time
23 #define RELOC(a) ((typeof(a))((unsigned long)(a) + gd->reloc_off))
56 case 2: /* set date & time */ in do_date()
57 if (strcmp(argv[1],"reset") == 0) { in do_date()
58 puts ("Reset RTC...\n"); in do_date()
68 puts("## Failed to set date after RTC reset\n"); in do_date()
70 /* initialize tm with current time */ in do_date()
77 /* insert new date & time */ in do_date()
97 case 1: /* get date & time */ in do_date()
108 printf ("Date: %4d-%02d-%02d (%sday) Time: %2d:%02d:%02d\n", in do_date()
130 * simple conversion of two-digit string with error checking
137 return (-1); in cnvrt2()
139 val = *str - '0'; in cnvrt2()
144 return (-1); in cnvrt2()
146 *valp = 10 * val + (*str - '0'); in cnvrt2()
167 int sec; in mk_date() local
170 if ((len - (ptr - datestr)) != 2) in mk_date()
171 return (-1); in mk_date()
173 len -= 3; in mk_date()
175 if (cnvrt2 (ptr, &sec)) in mk_date()
176 return (-1); in mk_date()
178 tmp->tm_sec = sec; in mk_date()
180 tmp->tm_sec = 0; in mk_date()
188 return (-1); in mk_date()
190 tmp->tm_year = 100 * century + year; in mk_date()
194 century = tmp->tm_year / 100; in mk_date()
196 return (-1); in mk_date()
197 tmp->tm_year = 100 * century + year; in mk_date()
210 tmp->tm_mon = val; in mk_date()
212 val > ((tmp->tm_mon==2) ? 29 : 31)) { in mk_date()
215 tmp->tm_mday = val; in mk_date()
221 tmp->tm_hour = val; in mk_date()
227 tmp->tm_min = val; in mk_date()
237 return (-1); in mk_date()
244 "get/set/reset date & time",
245 "[MMDDhhmm[[CC]YY][.ss]]\ndate reset\n"
246 " - without arguments: print date & time\n"
247 " - with numeric argument: set the system date & time\n"
248 " - with 'reset' argument: reset the RTC"