Lines Matching refs:unix_ms
37 int bt_cts_time_to_unix_ms(const struct bt_cts_time_format *ct_time, int64_t *unix_ms) in bt_cts_time_to_unix_ms() argument
53 (*unix_ms) = timeutil_timegm64(&date_time); in bt_cts_time_to_unix_ms()
54 if ((*unix_ms) == ((time_t)-1)) { in bt_cts_time_to_unix_ms()
57 LOG_DBG("CTS Write Unix: %lld", (*unix_ms)); in bt_cts_time_to_unix_ms()
58 (*unix_ms) *= MSEC_PER_SEC; in bt_cts_time_to_unix_ms()
60 (*unix_ms) += ((ct_time->fractions256 * MSEC_PER_SEC) / BT_CTS_FRACTION_256_MAX_VALUE); in bt_cts_time_to_unix_ms()
65 int bt_cts_time_from_unix_ms(struct bt_cts_time_format *ct_time, int64_t unix_ms) in bt_cts_time_from_unix_ms() argument
68 time_t unix_ts = unix_ms / MSEC_PER_SEC; in bt_cts_time_from_unix_ms()
71 unix_ms %= MSEC_PER_SEC; in bt_cts_time_from_unix_ms()
72 unix_ms *= BT_CTS_FRACTION_256_MAX_VALUE; in bt_cts_time_from_unix_ms()
73 unix_ms /= MSEC_PER_SEC; in bt_cts_time_from_unix_ms()
74 ct_time->fractions256 = unix_ms; in bt_cts_time_from_unix_ms()