MCPcopy Create free account
hub / github.com/codr7/hacktical-c / hc_time

Function hc_time

chrono/chrono.c:20–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20hc_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
39uint64_t hc_time_ns(const hc_time_t *t) {
40 const struct timespec now = hc_now().value;

Callers 1

slog_testsFunction · 0.50

Calls

no outgoing calls

Tested by 1

slog_testsFunction · 0.40