effect-io-ai

Package: effect
Module: DateTime

DateTime.nowInCurrentZone

Get the current time as a DateTime.Zoned, using the CurrentTimeZone.

Example

import { DateTime, Effect } from "effect"

Effect.gen(function* () {
  // will use the "Europe/London" time zone
  const now = yield* DateTime.nowInCurrentZone
}).pipe(DateTime.withCurrentZoneNamed("Europe/London"))

Signature

declare const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZone>

Source

Since v3.6.0