Skip to content

toTai64n

  • The core functions, which every industry uses.
toTai64n(isoString: string): string

Convert a UTC instant to its TAI64N label in the daemontools text form, @ and 24 lowercase hex digits.

  • The label is TAI: 8 bytes of 2^62 + TAI seconds since 1970-01-01T00:00:00 TAI, then 4 bytes of nanoseconds (Bernstein, TAI64 § TAI64N), printed as daemontools tai64n prints it.
  • TAI = UTC + (TAI − UTC), from the IERS leap-second table built into GMT (Leap_Second.dat through Bulletin C 72, 6 July 2026). The table is closed: the CGPM decided in 2026 that UTC becomes continuous on 20 May 2027, so after the last insertion (2016-12-31) TAI − UTC stays 37 s.
  • An inserted second has its own label: 2016-12-31T23:59:60Z is @40000000586846a400000000. A second 60 on any other day returns "".
  • Every nanosecond Temporal holds is kept; the label never has attoseconds.
  • Accepts any offset or bracketed zone toTAI accepts.
  • daemontools tai64n assumes the system clock counts TAI seconds since 1970-01-01 00:00:10 TAI (https://cr.yp.to/daemontools/tai64n.html): on a POSIX UTC clock its label is (TAI − UTC) − 10 = 27 s below this one from 2017 on, and fromTai64n reads it 27 s early.
  • "" before 1972-01-01, after 9999-12-31T23:59:59.999999999Z, and on invalid input.
ParameterTypeDescription
isoStringstringISO 8601 instant string

the TAI64N label, or "" on invalid input, a date before 1972, or after year 9999

import { toTai64n } from "@northguild/gmt/timescale/convert";
toTai64n("1992-06-02T08:06:43Z") // "@400000002a2b2c2d00000000" — Bernstein's example
output 

timescale/convert/toTai64n.ts

© 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.