summaryrefslogtreecommitdiff
path: root/src/libstddjb/sysclock_from_localtm.c
blob: 3bce55ab9bebbcbac0c7982ad6b4aa72a48c9fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <time.h>
#include <skalibs/uint64.h>
#include <skalibs/djbtime.h>

int sysclock_from_localtm (uint64_t *uu, struct tm const *l)
{
  uint64_t u ;
  if (!ltm64_from_localtm(&u, l)) return 0 ;
  if (!sysclock_from_ltm64(&u)) return 0 ;
  *uu = u ;
  return 1 ;
}