effect-io-ai

Package: effect
Module: DateTime

DateTime.withDate

Using the time zone adjusted Date, apply a function to the Date and return the result.

Example

import { DateTime } from "effect"

// get the time zone adjusted date in milliseconds
DateTime.unsafeMakeZoned(0, { timeZone: "Europe/London" }).pipe(
  DateTime.withDate((date) => date.getTime())
)

Signature

declare const withDate: { <A>(f: (date: Date) => A): (self: DateTime) => A; <A>(self: DateTime, f: (date: Date) => A): A; }

Source

Since v3.6.0