Hyperlinkv0.8.0-beta.28

DateTime

DateTime.nowInCurrentZoneconsteffect/DateTime.ts:2046
Effect.Effect<Zoned, never, CurrentTimeZone>

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"))
current time zone
export const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZone> = Effect.flatMap(now, setZoneCurrent)