Lines Matching full:tm
56 _der_timegm (struct tm *tm) in _der_timegm() argument
64 if (tm->tm_year > ASN1_MAX_YEAR) in _der_timegm()
67 if (tm->tm_year < 0) in _der_timegm()
69 if (tm->tm_mon < 0 || tm->tm_mon > 11) in _der_timegm()
71 if (tm->tm_mday < 1 || tm->tm_mday > (int)ndays[is_leap(tm->tm_year)][tm->tm_mon]) in _der_timegm()
73 if (tm->tm_hour < 0 || tm->tm_hour > 23) in _der_timegm()
75 if (tm->tm_min < 0 || tm->tm_min > 59) in _der_timegm()
77 if (tm->tm_sec < 0 || tm->tm_sec > 59) in _der_timegm()
80 for (i = 70; i < tm->tm_year; ++i) in _der_timegm()
83 for (i = 0; i < tm->tm_mon; ++i) in _der_timegm()
84 res += ndays[is_leap(tm->tm_year)][i]; in _der_timegm()
85 res += tm->tm_mday - 1; in _der_timegm()
87 res += tm->tm_hour; in _der_timegm()
89 res += tm->tm_min; in _der_timegm()
91 res += tm->tm_sec; in _der_timegm()
95 struct tm *
96 _der_gmtime(time_t t, struct tm *tm) in _der_gmtime() argument
101 memset(tm, 0, sizeof(*tm)); in _der_gmtime()
103 tm->tm_sec = secday % 60; in _der_gmtime()
104 tm->tm_min = (secday % 3600) / 60; in _der_gmtime()
105 tm->tm_hour = secday / 3600; in _der_gmtime()
116 tm->tm_year = 70; in _der_gmtime()
118 unsigned dayinyear = (is_leap(tm->tm_year) ? 366 : 365); in _der_gmtime()
121 tm->tm_year += 1; in _der_gmtime()
124 tm->tm_mon = 0; in _der_gmtime()
127 unsigned daysinmonth = ndays[is_leap(tm->tm_year)][tm->tm_mon]; in _der_gmtime()
131 tm->tm_mon++; in _der_gmtime()
133 tm->tm_mday = days + 1; in _der_gmtime()
135 return tm; in _der_gmtime()