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

#include <skalibs/uint64.h>
#include <skalibs/tai.h>
#include <skalibs/djbtime.h>
#include "djbtime-internal.h"

int utc_from_tai (uint64 *u, tai_t const *t)
{
  uint64 tt = t->x - 10 ;
  if (leapsecs_sub(&tt) < 0) return 0 ;
  *u = tt ;
  return 1 ;
}