summaryrefslogtreecommitdiff
path: root/src/libstddjb/tai_from_utc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/tai_from_utc.c')
-rw-r--r--src/libstddjb/tai_from_utc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstddjb/tai_from_utc.c b/src/libstddjb/tai_from_utc.c
new file mode 100644
index 0000000..ba9cea9
--- /dev/null
+++ b/src/libstddjb/tai_from_utc.c
@@ -0,0 +1,14 @@
+/* ISC license. */
+
+#include <skalibs/uint64.h>
+#include <skalibs/tai.h>
+#include <skalibs/djbtime.h>
+#include "djbtime-internal.h"
+
+int tai_from_utc (tai_t *t, uint64 u)
+{
+ if (leapsecs_add(&u, 0) < 0) return 0 ;
+ u += 10 ;
+ t->x = u ;
+ return 1 ;
+}