getDateIn
Signature
Section titled “Signature”getDateIn(units: Partial<Record<"years" | "months" | "weeks" | "days", number>>): stringReturn the PlainDate after today, as an ISO string, counted from the current time.
- Reads the clock once, after
unitsis checked. unitsis an object of unit amounts (years, months, weeks, days), such as{ days: 90 }. A duration string returns "". A time unit returns "", even at zero, asaddDatedoes; usegetDateTimeInorgetZonedInfor hours. A fractional amount returns "": use whole days.- Lengths are unsigned: a negative amount returns "".
getDateAgois the way back. { days: 0 }is a valid length and gives today, sogetDateIn({ days: 0 })equalsgetToday().- Counts from today in the system time zone, so a server’s result changes with its zone;
getZonedInnames one. - A missing day clamps to the end of the month: 31 January plus a month is 28 February, or 29 in a leap year.
- Each call reads the clock. To pin the start, use
addDate(getToday(), units). - Examples read the clock at 2027-06-15T12:00:00Z, with the system time zone UTC.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
units | Partial<Record<"years" | "months" | "weeks" | "days", number>> | unit amounts, such as { days: 90 }; never negative |
Returns
Section titled “Returns”ISO PlainDate string, or "" for invalid units, a negative amount, a time unit, an unavailable system zone or a result outside Temporal’s range
Related types
Section titled “Related types”Examples
Section titled “Examples”import { getDateIn } from "@northguild/gmt/plain/get";
getDateIn({ days: 90 }) // "2027-09-13"Source
Section titled “Source”Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else:© 2026 NorthGuild, all rights reserved.