parseFixUtcTimestamp
Signature
Section titled “Signature”parseFixUtcTimestamp(value: string): FixUtcTimestamp | nullRead a FIX UTCTimestamp as a UTC instant and the precision its digits state.
-
The format is
YYYYMMDD-HH:MM:SSorYYYYMMDD-HH:MM:SS.fraction. FIX Latest: “colons, dash, and period required”; “The fractions of seconds may be empty when no fractions of seconds are conveyed (in such a case the period is not conveyed)”. A period needs digits. -
The fraction digits state the precision (FIX Latest: “3 digits to convey milliseconds, 6 digits to convey microseconds, 9 digits to convey nanoseconds, 12 digits to convey picoseconds”):
Fraction digits precisionnone "second"3 "millisecond"6 "microsecond"9 "nanosecond"12 "picosecond" -
These are the FIX Latest widths. FIX 4.2 and 4.4 define only whole seconds and
.sss; this function still reads 6, 9 and 12 digits, and does not returnnullfor them. -
Precision is reported, never widened:
instantkeeps the digits sent, trailing zeros included, so.100stays.100Z. -
Temporal holds nanoseconds. For a 12-digit fraction the first nine digits go in
instantand the last three inpicoseconds; nothing is dropped. -
A second of
60is read only for one of the 27 inserted leap seconds in the IERS table built into GMT (Leap_Second.dat through Bulletin C 72; the table is closed).instantis then…T23:59:60…Z, whichformatFixUtcTimestamp,toTAIandisLeapSecondread back and other GMT functions refuse. A60on any other day, at any other hour or minute, or before 1972 returnsnull. -
Fields are checked, not clamped: 30 February, hour 24, minute 60 and month 13 return
null. The year is the four digits as written,0000to9999. -
Another number of digits is FIX’s “bilateral agreement” and returns
null; read it withparseDateTimeWithPatternor your own code, knowing the agreed precision. -
Which FIX field carries the stamp (
SendingTime,TransactTime) is the FIX dictionary’s concern, not this function’s. -
Returns
nullfor a non-string argument.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | A FIX UTCTimestamp (e.g. “20240615-14:30:00.123”) |
Returns
Section titled “Returns”the instant, precision, leap-second flag and picoseconds, or null on invalid input
FixUtcTimestamp
Section titled “FixUtcTimestamp”A FIX UTCTimestamp (YYYYMMDD-HH:MM:SS[.fraction]) read as an instant plus what the digits stated. Returned by parseFixUtcTimestamp.
import type { FixUtcTimestamp } from "@northguild/gmt";| Member | Type | Description |
|---|---|---|
instant | string | The moment as an ISO 8601 instant string ending in Z, with the fraction digits that were sent, up to the ninth. It keeps the digits sent, so .100 stays .100Z; it is therefore not always the string Temporal.Instant#toString() writes. In a leap second it is …T23:59:60…Z, which only the timescale/, gnss/ and finance/ functions read back. |
precision | "second" | "millisecond" | "microsecond" | "nanosecond" | "picosecond" (FixPrecision) | The precision the digit count stated: 0, 3, 6, 9 or 12 fraction digits. |
leapSecond | boolean | Whether the second was 60, an inserted leap second. |
picoseconds | number | Digits 10 to 12 of a 12-digit fraction, 0 to 999. 0 for every other precision. Temporal holds nanoseconds, so these are returned apart from instant. |
Related types
Section titled “Related types”Examples
Section titled “Examples”import { parseFixUtcTimestamp } from "@northguild/gmt/finance/parse";
parseFixUtcTimestamp("20240615-14:30:00.123456") // { instant: "2024-06-15T14:30:00.123456Z", precision: "microsecond", leapSecond: false, picoseconds: 0 }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.