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

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

int localtm_from_tai (struct tm *l, tai const *t, int tz)
{
  uint64_t u ;
  int h = ltm64_from_tai(&u, t) ;
  return h ? localtm_from_ltm64(l, u, !!tz | (h & 2)) : 0 ;
}