Reference · Streams, draws and seeds
dayKeyfunction
The day a moment falls on, in UTC or in the named IANA time zone.
Import it
import { dayKey } from "@johnmorrisdotca/tane";
Definition
function dayKey(at: Date, timeZone?: string): DayKey
Parameters
| Name | Type | Description |
|---|---|---|
at | Date | The moment to read as a calendar day. |
timeZone (optional) | string | The IANA time-zone name; UTC when omitted. |
Returns
string
The day a moment falls on, in UTC or in the named IANA time zone.
Examples
import { dayKey } from "@johnmorrisdotca/tane";
console.log(dayKey(new Date("2026-10-11T03:00:00Z"), "America/Toronto"));2026-10-10What it prints (run when this page was built)