# isValidEpcisTimeZoneOffset

Industry: Intermodal

## Signature

```ts
isValidEpcisTimeZoneOffset(value: string): boolean
isValidEpcisTimeZoneOffset(value: void | {} | null | undefined): boolean
isValidEpcisTimeZoneOffset(value: unknown): value is string
```

Return true when `value` is a GS1 EPCIS 2.0 `eventTimeZoneOffset`: the UTC offset the local clock ran at where a supply-chain event happened, written `±HH:MM`.

- EPCIS (ISO/IEC 19987) is GS1's event standard for supply-chain visibility. This is the check `isValidEpcisEvent` applies to the event's `eventTimeZoneOffset` field: that validator calls this one.
- The value must match `epcisTimeZoneOffset`, the pattern the EPCIS JSON schema gives: `±HH:MM` from `-14:00` to `+14:00`, the rule of EPCIS Standard Release 2.0 §7.4.1 (https://ref.gs1.org/standards/epcis/).
- **The pattern is the whole rule for a string.** Every value it matches is an offset Temporal reads, so this validator and `epcisTimeZoneOffset.test` agree on every string; the validator adds only the answer false for a non-string.
- A value that is not a string, a `String` object included, returns false. A true result narrows an `unknown` value to `string`.
- `Z`, `+0200`, `+02`, an offset with seconds and an offset past `14:00` are false.
- `-00:00` is true: the GS1 pattern matches it. `parseEpcisEvent` returns it as `+00:00`.
- It need not agree with an offset written in the event's `eventTime`. Check that field with `isValidEpcisEventTime`, or both with `isValidEpcisEvent`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | any value; a string is checked as an EPCIS `eventTimeZoneOffset` |

## Returns

boolean indicating validity

## Examples

```ts
import { isValidEpcisTimeZoneOffset } from "@northguild/gmt/intermodal/validate";

isValidEpcisTimeZoneOffset("-05:00") // true
```

## Source

[intermodal/validate/isValidEpcisTimeZoneOffset.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/intermodal/validate/isValidEpcisTimeZoneOffset.ts)
