skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

sysclock_from_localtm.c (289B)


      1 /* ISC license. */
      2 
      3 #include <time.h>
      4 #include <skalibs/uint64.h>
      5 #include <skalibs/djbtime.h>
      6 
      7 int sysclock_from_localtm (uint64_t *uu, struct tm const *l)
      8 {
      9   uint64_t u ;
     10   if (!ltm64_from_localtm(&u, l)) return 0 ;
     11   if (!sysclock_from_ltm64(&u)) return 0 ;
     12   *uu = u ;
     13   return 1 ;
     14 }