Install
Latest release: v1.14.2
pnpm add @northguild/gmtnpm install @northguild/gmtyarn add @northguild/gmtbun add @northguild/gmtWhat you get
Section titled “What you get”The package exports seven top-level namespaces:
// The most common helpers are re-exported from the package rootimport { addDate, getNow, formatRelativeZoned } from "@northguild/gmt";
// Import from name-spaced if you only want to focus on a certain signatureimport { addDate, getNow } from "@northguild/gmt/plain";import { addZoned, getNowZoned } from "@northguild/gmt/zoned";import { addUtc, getNowUtc } from "@northguild/gmt/utc";import { addUnix, getNowUnix } from "@northguild/gmt/unix";
// Of course we give you Temporal for fine-grained controlimport { Temporal } from "@northguild/gmt";| Namespace | What it covers |
|---|---|
Temporal |
Re-exported from @js-temporal/polyfill |
duration |
ISO 8601 duration string parsing, validation, and arithmetic |
plain |
Timezone-free helpers |
zoned |
Timezone-aware helpers |
unix |
Unix epoch (seconds or milliseconds) helpers |
utc |
UTC instant helpers |
regex |
Low-level regex building blocks |
You can also import members directly from the package root:
import { addDate, getNow, formatRelativeZoned } from "@northguild/gmt";