blob: 81f11560f730f764205598c4a6f5a375e33c24d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/* ISC license. */
#include <errno.h>
#include <time.h>
#include <skalibs/tai.h>
#include <skalibs/djbtime.h>
int ltm64_from_localtm (uint64_t *uu, struct tm const *l)
{
struct tm ll = *l ;
time_t u = mktime(&ll) ;
if (u == (time_t)-1) return (errno = EINVAL, 0) ;
*uu = TAI_MAGIC + u ;
return 1 ;
}
|