Lines Matching refs:date_time
39 struct tm date_time; in bt_cts_time_to_unix_ms() local
41 date_time.tm_year = sys_le16_to_cpu(ct_time->year); /* year (little endian) */ in bt_cts_time_to_unix_ms()
42 date_time.tm_year -= TIME_UTILS_BASE_YEAR; in bt_cts_time_to_unix_ms()
43 date_time.tm_mon = ct_time->mon - 1; /* month start from 1, but need from 0 */ in bt_cts_time_to_unix_ms()
44 date_time.tm_mday = ct_time->mday; /* day of month */ in bt_cts_time_to_unix_ms()
45 date_time.tm_hour = ct_time->hours; /* hours of day */ in bt_cts_time_to_unix_ms()
46 date_time.tm_min = ct_time->min; /* minute of hour */ in bt_cts_time_to_unix_ms()
47 date_time.tm_sec = ct_time->sec; /* seconds of minute */ in bt_cts_time_to_unix_ms()
48 date_time.tm_wday = ct_time->wday % 7; /* for sundays convert to 0, else keep same */ in bt_cts_time_to_unix_ms()
50 LOG_DBG("CTS Write Time: %d/%d/%d %d:%d:%d", date_time.tm_year, date_time.tm_mon, in bt_cts_time_to_unix_ms()
51 date_time.tm_mday, date_time.tm_hour, date_time.tm_min, date_time.tm_sec); in bt_cts_time_to_unix_ms()
53 (*unix_ms) = timeutil_timegm64(&date_time); in bt_cts_time_to_unix_ms()
67 struct tm date_time; in bt_cts_time_from_unix_ms() local
79 if (gmtime_r(&unix_ts, &date_time) == NULL) { in bt_cts_time_from_unix_ms()
82 date_time.tm_year += TIME_UTILS_BASE_YEAR; in bt_cts_time_from_unix_ms()
84 LOG_DBG("CTS Read Time: %d/%d/%d %d:%d:%d", date_time.tm_year, date_time.tm_mon, in bt_cts_time_from_unix_ms()
85 date_time.tm_mday, date_time.tm_hour, date_time.tm_min, date_time.tm_sec); in bt_cts_time_from_unix_ms()
91 ct_time->year = sys_cpu_to_le16(date_time.tm_year); in bt_cts_time_from_unix_ms()
92 ct_time->mon = date_time.tm_mon + 1; /* months starting from 1 */ in bt_cts_time_from_unix_ms()
93 ct_time->mday = date_time.tm_mday; /* Day of month */ in bt_cts_time_from_unix_ms()
94 ct_time->hours = date_time.tm_hour; /* hours */ in bt_cts_time_from_unix_ms()
95 ct_time->min = date_time.tm_min; /* minutes */ in bt_cts_time_from_unix_ms()
96 ct_time->sec = date_time.tm_sec; /* seconds */ in bt_cts_time_from_unix_ms()
98 ct_time->wday = date_time.tm_wday; in bt_cts_time_from_unix_ms()