localtm_from_tai.c (267B)
1 /* ISC license. */ 2 3 #include <time.h> 4 #include <skalibs/uint64.h> 5 #include <skalibs/djbtime.h> 6 7 int localtm_from_tai (struct tm *l, tai const *t, int tz) 8 { 9 uint64_t u ; 10 int h = ltm64_from_tai(&u, t) ; 11 return h ? localtm_from_ltm64(l, u, !!tz | (h & 2)) : 0 ; 12 }