# assertDateBefore Source: https://smartassertions.dev/assertions/assertDateBefore/ Index of every page: https://smartassertions.dev/llms.txt Assert that a Date holds an earlier instant than the expected one, with type-narrowing. Comparing two instants through assertLessThan means reading epoch milliseconds out of the failure. This reports both Dates in ISO form. ## Usage ```ts import { assertDateBefore } from "@kensio/smartass"; const createdAt: unknown = new Date("2026-01-01T00:00:00.000Z"); assertDateBefore(createdAt, new Date("2026-06-01T00:00:00.000Z")); // createdAt is now narrowed to Date ``` ## Source Source file: [`src/assert/date-before/date-before.assert.ts`](https://github.com/KensioSoftware/smartass/blob/main/src/assert/date-before/date-before.assert.ts)