| 18 | } |
| 19 | |
| 20 | hc_time_t hc_time(int year, |
| 21 | int month, |
| 22 | int day, |
| 23 | int hour, |
| 24 | int minute, |
| 25 | int second) { |
| 26 | struct tm t = {0}; |
| 27 | t.tm_year = year - 1900; |
| 28 | t.tm_mon = month - 1; |
| 29 | t.tm_mday = day; |
| 30 | t.tm_hour = hour; |
| 31 | t.tm_min = minute; |
| 32 | t.tm_sec = second; |
| 33 | |
| 34 | hc_time_t result = {0}; |
| 35 | result.value.tv_sec = timegm(&t); |
| 36 | return result; |
| 37 | } |
| 38 | |
| 39 | uint64_t hc_time_ns(const hc_time_t *t) { |
| 40 | const struct timespec now = hc_now().value; |