Interface: AstmDate
A parsed ASTM date/time. Immutable plain data; the populated fields extend
exactly as far as AstmDate.precision. Absent components are left
undefined rather than defaulted, so a consumer can tell "midnight" from
"no time given". No timezone is modeled - the value is instrument-local.
Example
import { parseAstmDate } from "@cosyte/astm";
const d = parseAstmDate("20240315");
d?.precision; // "day"
d?.hour; // undefined (not 0)
Properties
day?
readonlyoptionalday?:number
hour?
readonlyoptionalhour?:number
minute?
readonlyoptionalminute?:number
month?
readonlyoptionalmonth?:number
precision
readonlyprecision:AstmDatePrecision
How far the components are populated.
raw
readonlyraw:string
The raw digit string as it appeared on the wire.
second?
readonlyoptionalsecond?:number
truncated?
readonlyoptionaltruncated?:true
true when the digit run does not align to a whole-component boundary - an odd number of
digits that cuts a two-digit component (month/day/hour/minute/second) in half (lengths 5, 7, 9,
11, 13). The full run is preserved in AstmDate.raw and the structured value is truncated
to the last complete component - the dangling digit is never zero-filled into a fabricated
time. Absent (never false) for a clean value. A caller surfaces this as a value-free
ASTM_RECORD_PARTIAL_TIMESTAMP warning.
year
readonlyyear:number