Lines Matching refs:tm
9 int __getzonename(const char *restrict s, struct tm *restrict tm)
12 struct tm old;
13 memcpy(&old, tm, sizeof(struct tm));
25 /* In the structure struct tm, tm_zone is declared as const char * type, so use static */
30 tm->__tm_zone = buf;
34 struct tm *tmp = localtime(&t);
36 tm->tm_isdst = tmp->tm_isdst;
41 int __getgmtoff(const char *restrict s, struct tm *restrict tm)
55 tm->__tm_gmtoff = 0;
87 tm->__tm_gmtoff = sign * (h * 3600 + m * 60);
92 char *strptime(const char *restrict s, const char *restrict f, struct tm *restrict tm)
118 dest = &tm->tm_wday;
123 dest = &tm->tm_mon;
128 s = strptime(s, nl_langinfo(D_T_FMT), tm);
137 dest = &tm->tm_mday;
142 s = strptime(s, "%m/%d/%y", tm);
146 s = strptime(s, "%Y-%m-%d", tm);
152 dest = &tm->tm_year;
165 dest = &tm->tm_hour;
171 dest = &tm->tm_hour;
176 dest = &tm->tm_yday;
182 dest = &tm->tm_mon;
188 dest = &tm->tm_min;
200 tm->tm_hour %= 12;
207 tm->tm_hour %= 12;
208 tm->tm_hour += 12;
214 s = strptime(s, nl_langinfo(T_FMT_AMPM), tm);
218 s = strptime(s, "%H:%M", tm);
231 if (localtime_r(&secs, tm) == NULL) {
237 dest = &tm->tm_sec;
242 s = strptime(s, "%H:%M:%S", tm);
259 tm->tm_wday = wday % 7;
270 dest = &tm->tm_wday;
275 if (!(s = strptime(s, "%e-%b-%Y", tm))) {
296 s = strptime(s, nl_langinfo(D_FMT), tm);
300 s = strptime(s, nl_langinfo(T_FMT), tm);
309 dest = &tm->tm_year;
315 s += __getgmtoff((const char *)s, tm);
319 s += __getzonename((const char *)s, tm);
333 switch((char *)dest - (char *)tm) {
334 case offsetof(struct tm, tm_yday):
365 tm->tm_year = relyear;
366 if (want_century & 2) tm->tm_year += century * 100 - 1900;
367 else if (tm->tm_year <= 68) tm->tm_year += 100;