effect-io-ai

Package: effect
Module: DateTime

DateTime.isFutureUnsafe

Checks synchronously if a DateTime is in the future compared to the current time.

When to use

Use when checking whether a DateTime is in the future with a synchronous live-clock read and Clock-based testability is not needed.

Details

This is a synchronous version that uses Date.now() directly.

Example (Checking future DateTime values unsafely)

import { DateTime } from "effect"

const now = DateTime.nowUnsafe()
const futureDate = DateTime.add(now, { hours: 1 })

console.log(DateTime.isFutureUnsafe(futureDate)) // true
console.log(DateTime.isFutureUnsafe(now)) // false

Signature

declare const isFutureUnsafe: (self: DateTime) => boolean

Source

Since v4.0.0