liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8049714cdbb1470b09d27b9a8e1f01b4010a383e
parent 8106389b74c3d6971f58eeb4187e82d890cb29f8
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 28 Oct 2025 20:17:35 +0000

rename anoia.tai64.to-utc as to-unix

it's a far more accurate name for somethingthat return non-leap
seconds since 1-1-1970

Diffstat:
Mpkgs/anoia/tai64.fnl | 6+++---
Mpkgs/logshippers/victorialogsend.fnl | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pkgs/anoia/tai64.fnl b/pkgs/anoia/tai64.fnl @@ -64,7 +64,7 @@ {:s sec :n nano}) nil)) -(fn to-utc [tai] +(fn to-unix [tai] (values (- tai.s (leap-seconds tai.s)) tai.n)) (define-tests @@ -72,8 +72,8 @@ (from-timestamp "@4000000068e2f0d3257dc09b") {:s 1759703251 :n 628998299}) - (let [(s n) (to-utc (from-timestamp "@4000000068e2f0d3257dc09b"))] + (let [(s n) (to-unix (from-timestamp "@4000000068e2f0d3257dc09b"))] (expect= [s n] [1759703214 628998299])) ) -{ : from-timestamp : to-utc } +{ : from-timestamp : to-unix } diff --git a/pkgs/logshippers/victorialogsend.fnl b/pkgs/logshippers/victorialogsend.fnl @@ -48,7 +48,7 @@ Host: %s\ path host authstr))) (fn format-timestamp-rfc3339 [timestamp prec] - (let [(sec nano) (-> timestamp tai64.from-timestamp tai64.to-utc) + (let [(sec nano) (-> timestamp tai64.from-timestamp tai64.to-unix) subsec (string.sub (string.format "%09d" nano) 1 prec)] (.. (os.date "!%FT%T" sec) "." subsec