effect-io-ai

Package: effect
Module: DateTime

DateTime.nowInCurrentZone

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

Example (Getting the current time in the current zone)

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