# getDateTimeIn

:::caution[Unreleased]
Not in `@northguild/gmt` 1.20.0 on npm yet. It is on `main` and ships in the next release.
:::

## Signature

```ts
getDateTimeIn(units: Partial<Record<keyof DurationLike, number>>): string
```

Return the PlainDateTime after now, as an ISO string, counted from the current time.

- Reads the clock once, after `units` is checked.
- `units` is an object of unit amounts (years to nanoseconds), such as `{ days: 90 }`. A duration string returns "". A fractional amount returns "": write `{ hours: 36 }` for a day and a half.
- Lengths are unsigned: a negative amount returns "". `getDateTimeAgo` is the other direction.
- `{ days: 0 }` is a valid length and gives now.
- Counts on the wall clock of the system time zone. It knows nothing of daylight saving, so the result can name a time that does not exist there; `getZonedIn` gives a real instant.
- Whole seconds, floored. The sub-second route is `addDateTime(getNow(), units)`.
- 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 `addDateTime(getNow(), units)`.
- Examples read the clock at 2027-06-15T12:00:00Z, with the system time zone UTC.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `units` | `Partial<Record<keyof DurationLike, number>>` | unit amounts, such as `{ days: 90 }`; never negative |

## Returns

ISO PlainDateTime string in whole seconds, or "" for invalid `units`, a negative amount, an unavailable system zone or a result outside Temporal's range

## Related types

- [`DateTimeDurationUnit`](/gmt/reference/types/DateTimeDurationUnit)

## Examples

```ts
import { getDateTimeIn } from "@northguild/gmt/plain/get";

getDateTimeIn({ days: 90 }) // "2027-09-13T12:00:00"
```

## Source

[plain/get/getDateTimeIn.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/plain/get/getDateTimeIn.ts)
