Skip to content

TAI64N Log Reader

  • The core functions, which every industry uses.

The @4000… at the start of a daemontools, multilog or s6 log line is a TAI64N label: 24 hex digits that count seconds and nanoseconds on the TAI scale. fromTai64n reads a label as the UTC instant it names, and toTai64n writes one. toTAI gives the same instant as a TAI reading, taiMinusUtc gives the offset between the two scales at that moment, and isLeapSecond says whether it falls in an inserted second.

Paste up to 12 log lines, or pick a preset. The label is the text before the first space or tab, with or without the @, in upper or lower case. Choose a line to see its instant, its TAI reading and the offset, with the exact calls under them. The last box writes a label from an instant.

1. Paste log lines

The same instant written with and without the @, and in lower and upper case: the library reads either.

2. What each label says

Pick a line to see its details.

Paste log lines that start with a TAI64N label, or pick a preset.

3. The selected line

UTC instant
no result
TAI reading
no result
TAI − UTC
no result

Give a log line to read its label.

4. Write a label

Label
no result
Read back
no result

Labels are TAI. Bernstein’s TAI64 and TAI64N pages define a label as 2^62 plus the TAI seconds since 1970-01-01 00:00:00 TAI, then four bytes of nanoseconds, and optionally four of attoseconds. TAI has no leap seconds and UTC has had 27 inserted since 1972, so the offset grows: 36 s for the whole of 2016 and 37 s from 2017-01-01. Every row shows the figure for its own instant, and no single figure covers a log that crosses a change.

Inside an inserted second. The last minute of 2016 had 61 seconds, and UTC names the extra one 23:59:60. The label @40000000586846a400000000 is that second, and fromTai64n returns 2016-12-31T23:59:60Z for it. The row is marked as inside an inserted second. The IERS Bulletin C announces each one, and the BIPM keeps the TAI − UTC table.

Before 1972 there is no label to read. UTC as we know it, with whole-second steps, starts on 1972-01-01. A label that names an earlier moment has no UTC instant to give, so the library returns an empty string and the row shows NO SIGNAL.

What the library refuses. A first token that is not a label (a plain timestamp, say), a label that is not 16, 24 or 32 hex digits and a label that names a moment before 1972 all come back empty, and the row says so. The reader does not trim a line, so a leading space makes an empty label. The attoseconds of a TAI64NA label are dropped, because the library keeps nanoseconds.

daemontools on a UTC clock. daemontools’ tai64n assumes the system clock counts TAI seconds from 1970-01-01 00:00:10 TAI, so on a host whose clock is set to UTC it writes 2^62 + 10 + the Unix seconds. This tool reads every label as true TAI, so such a label reads 27 s early for any time since 2017-01-01: TAI − UTC is 37 s, less the 10 s daemontools assumes. s6 on a UTC clock writes true TAI. The tool does not correct this, because a label does not say which clock wrote it. See the preset for daemontools on a UTC clock. The skarnet s6 documentation describes the same labels.

fromTai64n("@40000000659200a500000000"); // "2024-01-01T00:00:00Z"
toTai64n("2016-12-31T23:59:60Z"); // "@40000000586846a400000000"
fromTai64n("@40000000586846a400000000"); // "2016-12-31T23:59:60Z"
fromTai64n("@400000000000000000000000"); // ""

An empty string is the library’s answer for a label it cannot read, and the tool shows NO SIGNAL with the reason. That is different from a line with a real answer.

Worth trying: Across the 2016 leap second — 36 s, 36 s and 37 s on three adjacent seconds.

Reference: fromTai64n, toTai64n, taiMinusUtc and nextLeapSecond.

© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.