Package: effect
Module: DateTime
Create a Layer from the given IANA time zone identifier.
Details
This layer provides the CurrentTimeZone service with a named time zone.
If the time zone identifier is invalid, the layer will fail.
Example (Providing named time zone layers)
import { DateTime, Effect } from "effect"
const layer = DateTime.layerCurrentZoneNamed("Europe/London")
const program = Effect.gen(function*() {
const now = yield* DateTime.nowInCurrentZone
return DateTime.formatIsoZoned(now)
})
Effect.provide(program, layer)
Signature
declare const layerCurrentZoneNamed: (zoneId: string) => Layer.Layer<CurrentTimeZone, IllegalArgumentError>
Since v3.6.0