Skip to content

timeZone

The time zone the grid shows instants in — and counts « today » in.

Typestring
Default'UTC'
Live update (update())Yes
Angularthe [timeZone] input
<dz-grid>the time-zone attribute
Declared inpackages/dom/src/settings.ts

An IANA zone name ('Europe/London', 'Pacific/Auckland'). An instant column holds moments (epoch milliseconds, or ISO text with an offset); the grid writes each one as the clock reads in this zone, and its filters, editors and date shortcuts (« today », « last 7 days ») count days in it too. A day column holds calendar days ('2026-03-02'), which belong to no zone: the zone never moves them.

The default is UTC, not the reader’s zone: the same rows show the same text on every machine. To follow the reader, give it theirs: Intl.DateTimeFormat().resolvedOptions().timeZone. A name that is not a zone throws a RangeError: from createGrid, or from update(), which then leaves the grid as it was. The <dz-grid> attribute does not throw: it leaves the value out and tells an invalid-setting warning.

import { createGrid } from '@dzgrid/dom';
import { EN } from '@dzgrid/dom/locales/en';
type Flight = { id: string; route: string; lands: number };
const grid = createGrid<Flight>(document.getElementById('flights')!, {
rows: [{ id: 'f1', route: 'Harbour → Summit', lands: 1772442000000 }],
columns: [
{ id: 'route', header: 'Route' },
{ id: 'lands', header: 'Lands', type: 'instant', instantFormat: { date: true, time: true } },
],
getRowId: (f) => f.id,
messages: EN,
timeZone: 'Pacific/Auckland',
});
grid.update({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }); // the reader's own

The same instants on every machine: written as the clock reads in Auckland.

  • locale — how the date and time are written.
  • clock — the « now » date shortcuts count from.
  • Columns — days and instants.