date-tz
Dates and times in any time zone, in TypeScript, with no dependencies.
What it's for
Installation
npm install @open-rlb/date-tzExample
import { DateTz } from '@open-rlb/date-tz';
// Message sent at 08:00 in Rome (CET, UTC+1)
const sent = DateTz.parse('2026-01-15 08:00:00', 'YYYY-MM-DD HH:mm:ss', 'Europe/Rome');
// What does the Tokyo reader (JST, UTC+9) see?
const forTokyo = sent.cloneToTimezone('Asia/Tokyo');
forTokyo.toString(); // '2026-01-15 16:00:00'
sent.toString(); // '2026-01-15 08:00:00' ← original unchangedWhat it does
No dependencies
New rules already included
Try it in the browser
Dates that travel intact
DST without surprises
Strict parsing
Requirements
- No runtime dependencies
- Node.js or a browser, with the Intl API and IANA time zone data
- CommonJS package with TypeScript types, compiled for ES2024
- Dates from 1 January 1970 onwards
