summaryrefslogtreecommitdiff
path: root/src/libstddjb/sysclock_from_ltm64.c
blob: 8e951d53f27936d4ab96bc0c01219e186d6ebe8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ISC license. */

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

#ifdef SKALIBS_FLAG_CLOCKISTAI

int sysclock_from_ltm64 (uint64_t *u)
{
  tai_t t ;
  if (!tai_from_ltm64(&t, *u)) return 0 ;
  *u = t.x - 10U ;
  return 1 ;
}

#else

int sysclock_from_ltm64 (uint64_t *u)
{
  return utc_from_sysclock(u) ;
}

#endif