Package: effect
Module: DateTime
Sets the time zone of a DateTime safely from an IANA time zone identifier. If the
time zone is invalid, None will be returned.
Example (Setting named time zones safely)
import { DateTime, Effect } from "effect"
Effect.gen(function*() {
const now = yield* DateTime.now
// set the time zone, returns an Option
DateTime.setZoneNamed(now, "Europe/London")
})
Signature
declare const setZoneNamed: { (zoneId: string, options?: { readonly adjustForTimeZone?: boolean | undefined; readonly disambiguation?: Disambiguation | undefined; }): (self: DateTime) => Option.Option<Zoned>; (self: DateTime, zoneId: string, options?: { readonly adjustForTimeZone?: boolean | undefined; readonly disambiguation?: Disambiguation | undefined; }): Option.Option<Zoned>; }
Since v3.6.0