effect-io-ai

Package: effect
Module: DateTime

DateTime.make

Create a DateTime from one of the following:

If the input is invalid, None will be returned.

Example

import { DateTime } from "effect"

// from Date
DateTime.make(new Date())

// from parts
DateTime.make({ year: 2024 })

// from string
DateTime.make("2024-01-01")

Signature

declare const make: <A extends DateTime.Input>(input: A) => Option.Option<DateTime.PreserveZone<A>>

Source

Since v3.6.0