formatCcsdsAsciiA
Signature
Section titled “Signature”formatCcsdsAsciiA(isoString: string, fractionalSecondDigits?: FractionalDigit): stringWrite an instant as a CCSDS ASCII Time Code A string (YYYY-MM-DDThh:mm:ss.d…dZ).
- CCSDS 301.0-B-4 §3.5.1.1. The instant is converted to UTC; the
Zis always written. fractionalSecondDigitsworks as in Temporal’stoString: omitted or"auto"writes the shortest fraction that keeps every nanosecond,0writes no fraction and no period, and1to9write exactly that many digits. Extra digits are cut, never rounded, so the result never moves into the next second, day or year.- An inserted leap second is written as
…T23:59:60Z. A second of 60 that is not one of the 27 inserted leap seconds (for example2016-12-31T23:58:60Z) returns "". - "" for a date-time with no offset, a UTC year outside 0001 to 9999, a
fractionalSecondDigitsTemporal refuses (10,-1,null,"3"), and invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
isoString | string | ISO 8601 instant string, with Z or an offset |
fractionalSecondDigits | FractionalDigit | "auto" (default) or 0 to 9 |
Returns
Section titled “Returns”the Code A text, or "" on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”import { formatCcsdsAsciiA } from "@northguild/gmt/timescale/format";
formatCcsdsAsciiA("2024-06-15T12:30:00.123456789+02:00", 6) // "2024-06-15T10:30:00.123456Z"Source
Section titled “Source”© 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.