Lines Matching defs:tm

50 static void determine_days(struct tm *tm)
55 int y = tm->tm_year + 1900;
56 int m = tm->tm_mon;
57 int d = tm->tm_mday;
60 tm->tm_yday = ydays[m] + d - 1;
63 tm->tm_yday += leap_year(y);
73 tm->tm_wday = (d + (13 * m) / 5 + y + y / 4 + c / 4 + 5 * c + 6) % 7;
76 int ossl_asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d)
83 struct tm tmp;
242 /* if tm is NULL, no need to adjust */
243 if (tm != NULL) {
258 /* success, check if tm should be filled */
259 if (tm != NULL)
260 *tm = tmp;
267 ASN1_TIME *ossl_asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type)
327 struct tm *ts;
328 struct tm data;
356 struct tm tm;
358 if (!ASN1_TIME_to_tm(t, &tm))
364 ret = ossl_asn1_time_from_tm(ret, &tm, V_ASN1_GENERALIZEDTIME);
383 struct tm tm;
413 if (!ossl_asn1_time_to_tm(&tm, &t))
415 if (is_utc(tm.tm_year)) {
441 int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm)
447 memset(tm, 0, sizeof(*tm));
448 if (OPENSSL_gmtime(&now_t, tm) != NULL)
453 return ossl_asn1_time_to_tm(tm, s);
459 struct tm tm_from, tm_to;
474 int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm)
476 return ASN1_TIME_print_ex(bp, tm, ASN1_DTFLGS_RFC822);
480 int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags)
482 return ossl_asn1_time_print_ex(bp, tm, flags) > 0;
488 int ossl_asn1_time_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags)
492 struct tm stm;
496 if (!ossl_asn1_time_to_tm(&stm, tm))
499 l = tm->length;
500 v = (char *)tm->data;
504 if (tm->type == V_ASN1_GENERALIZEDTIME) {
512 if (tm->length > 15 && v[14] == period) {
551 struct tm stm, ttm;
572 struct tm tm;
574 if (!ASN1_TIME_to_tm(t, &tm))
577 return ossl_asn1_time_from_tm(t, &tm, V_ASN1_UNDEF) != NULL;