Lines Matching refs:tm
49 void rtc_time64_to_tm(time64_t time, struct rtc_time *tm)
58 tm->tm_wday = (days + 4) % 7;
68 tm->tm_year = year - 1900;
69 tm->tm_yday = days + 1;
79 tm->tm_mon = month;
80 tm->tm_mday = days + 1;
82 tm->tm_hour = secs / 3600;
83 secs -= tm->tm_hour * 3600;
84 tm->tm_min = secs / 60;
85 tm->tm_sec = secs - tm->tm_min * 60;
87 tm->tm_isdst = 0;
94 int rtc_valid_tm(struct rtc_time *tm)
96 if (tm->tm_year < 70 ||
97 tm->tm_year > (INT_MAX - 1900) ||
98 ((unsigned int)tm->tm_mon) >= 12 ||
99 tm->tm_mday < 1 ||
100 tm->tm_mday > rtc_month_days(tm->tm_mon,
101 ((unsigned int)tm->tm_year + 1900)) ||
102 ((unsigned int)tm->tm_hour) >= 24 ||
103 ((unsigned int)tm->tm_min) >= 60 ||
104 ((unsigned int)tm->tm_sec) >= 60)
115 time64_t rtc_tm_to_time64(struct rtc_time *tm)
117 return mktime64(((unsigned int)tm->tm_year + 1900), tm->tm_mon + 1,
118 tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
125 ktime_t rtc_tm_to_ktime(struct rtc_time tm)
127 return ktime_set(rtc_tm_to_time64(&tm), 0);