# epcisEventTime

Industry: Core

```ts
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.

## Examples

```ts
import { epcisEventTime } from "@northguild/gmt";
```

```ts
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)
```

## Source

[regex/epcis.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/regex/epcis.ts)
