diff options
Diffstat (limited to 'src/libstddjb/sysclock_from_localtm.c')
-rw-r--r-- | src/libstddjb/sysclock_from_localtm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstddjb/sysclock_from_localtm.c b/src/libstddjb/sysclock_from_localtm.c new file mode 100644 index 0000000..6408fc8 --- /dev/null +++ b/src/libstddjb/sysclock_from_localtm.c @@ -0,0 +1,15 @@ +/* ISC license. */ + +#include <sys/types.h> +#include <time.h> +#include <skalibs/uint64.h> +#include <skalibs/djbtime.h> + +int sysclock_from_localtm (uint64 *uu, struct tm const *l) +{ + uint64 u ; + if (!ltm64_from_localtm(&u, l)) return 0 ; + if (!sysclock_from_ltm64(&u)) return 0 ; + *uu = u ; + return 1 ; +} |