Skip to content

epcisEventTime

  • The core functions, which every industry uses.
const epcisEventTime: RegExp = /^([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|(([+]|[-])((0[0-9]|1[0-3]):([0-5][0-9])|14:00)))$/;

RegExp matching a GS1 EPCIS 2.0 eventTime (and recordTime): the DateTimeStamp pattern of the EPCIS XSD (https://ref.gs1.org/standards/epcis/epcglobal-epcis-2_0.xsd, a normative artefact of EPCIS 2.0 / ISO/IEC 19987), verbatim and anchored.

import { epcisEventTime } from "@northguild/gmt";
epcisEventTime.test("2024-06-15T14:30:00Z") // true
epcisEventTime.test("2024-06-15T14:30:00.123-05:00") // true
epcisEventTime.test("2024-06-15T14:30Z") // false (seconds are required)
epcisEventTime.test("2024-06-15T14:30:00") // false (Z or an offset is required)
epcisEventTime.test("2024-06-15T14:30:00+15:00") // false (offset past the range GS1 allows)

regex/epcis.ts

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.