isValidEpcisEventTime
Signature
Section titled “Signature”isValidEpcisEventTime(value: string): booleanisValidEpcisEventTime(value: void | {} | null | undefined): booleanisValidEpcisEventTime(value: unknown): value is stringReturn true when value is a real GS1 EPCIS 2.0 eventTime: the moment a supply-chain event happened, written as a date and time with Z or a UTC offset.
- EPCIS (ISO/IEC 19987) is GS1’s event standard for supply-chain visibility. This is the check
isValidEpcisEventapplies to the event’seventTimefield: that validator calls this one. - The value must match
epcisEventTime, theDateTimeStamppattern of the EPCIS XSD:YYYY-MM-DDTHH:MM:SS, an optional fraction, thenZor a±HH:MMoffset up to14:00. Seconds are required,TandZare upper-case, and nothing may follow. - Checks the calendar as well as the shape. The pattern proves the shape alone, so it matches a day the month does not have:
2024-02-30and2023-02-29are false here. - GMT rule: a fraction longer than nine digits is false, although the pattern matches a fraction of any length. An instant holds nanoseconds, and
parseEpcisEventdoes not drop digits. - False for a leap second (
:60), a space separator, an expanded year and a bracketed zone, none of which the pattern matches. - An event also needs an
eventTimeZoneOffset: check it withisValidEpcisTimeZoneOffset, or both fields withisValidEpcisEvent. Read an event withparseEpcisEvent. - A value that is not a string, a
Stringobject included, returns false. A true result narrows anunknownvalue tostring.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | any value; a string is checked as an EPCIS eventTime |
Returns
Section titled “Returns”boolean indicating validity
Examples
Section titled “Examples”import { isValidEpcisEventTime } from "@northguild/gmt/intermodal/validate";
isValidEpcisEventTime("2024-06-15T14:30:00Z") // trueSource
Section titled “Source”Accessibility
© 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.