Reference · Streams, draws and seeds
nextDayStartfunction
The first moment of the day after the one at falls on, in that zone: when
a daily seed next changes. Found by searching the next 27 hours for the
millisecond the date turns, so daylight saving and half-hour zones need no
special case.
Import it
import { nextDayStart } from "@johnmorrisdotca/tane";
Definition
function nextDayStart(at: Date, timeZone?: string): Date
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
Date
The first moment of the day after the one at falls on, in that zone: when a daily seed next changes. Found by searching the next 27 hours for the millisecond the date turns, so daylight saving and half-hour zones need no special case.
Examples
import { nextDayStart } from "@johnmorrisdotca/tane";
console.log(nextDayStart(new Date("2026-10-11T12:00:00Z"), "UTC").toISOString());2026-10-12T00:00:00.000ZWhat it prints (run when this page was built)