# Sleep until `step.sleepUntil()`
Source: https://www.inngest.com/docs/reference/functions/step-sleep-until

description = `Sleep until a specific date time with step.sleepUntil()`;

## `step.sleepUntil(id, datetime): Promise`

<Row>
  <Col>
    <Properties>
      <Property name="id" type="string" required>
        The ID of the step. This will be what appears in your function's logs and is used to memoize step state across function versions.
      </Property>
      <Property name="datetime" type="Date | string | Temporal.Instant | Temporal.ZonedDateTime" required>
        The datetime at which to continue execution of your function. This can be:

        * A [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) object
        * Any date time `string` in [the format accepted by the `Date` object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format), i.e. `YYYY-MM-DDTHH:mm:ss.sssZ` or simplified forms like `YYYY-MM-DD` or `YYYY-MM-DDHH:mm:ss`
        * <VersionBadge version="3.33.0+" /> [`Temporal.Instant`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant)
        * <VersionBadge version="3.33.0+" /> [`Temporal.ZonedDateTime`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime)
      </Property>
    </Properties>
  </Col>
  <Col>
  <CodeGroup>
  ```ts {{ title: "v3" }}
  // Sleep until the new year
  await step.sleepUntil("happy-new-year", "2024-01-01");

  // Sleep until September ends
  await step.sleepUntil("wake-me-up", "2023-09-30T11:59:59");

  // Sleep until the end of the this week
  dayjs().endOf("week").toDate();
  await step.sleepUntil("wait-for-end-of-the-week", date);

  // Sleep until tea time in London
  Temporal.ZonedDateTime.from("2025-05-01T16:00:00+01:00[Europe/London]");
  await step.sleepUntil("british-tea-time", teaTime);

  // Sleep until the end of the day
  Temporal.Now.instant();
  now.round({ smallestUnit: "day", roundingMode: "ceil" });
  await step.sleepUntil("done-for-today", endOfDay);
  ```
  ```ts {{ title: "v2" }}
  // Sleep until the new year
  await step.sleepUntil("2024-01-01");

  // Sleep until September ends
  await step.sleepUntil("2023-09-30T11:59:59");

  // Sleep until the end of the this week
  dayjs().endOf('week').toDate();
  await step.sleepUntil(date)
  ```
  </CodeGroup>
  </Col>
</Row>

<Callout>
  `step.sleepUntil()` must be called using `await` or some other Promise handler to ensure your function sleeps correctly.
</Callout>