effect-io-ai

Package: effect
Module: DateTime

DateTime.withDateUtc

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

Example

import { DateTime } from "effect"

// get the date in milliseconds
DateTime.unsafeMake(0).pipe(
  DateTime.withDateUtc((date) => date.getTime())
)

Signature

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

Source

Since v3.6.0