effect-io-ai

Package: effect
Module: DateTime

DateTime.setZoneNamedUnsafe

Sets the time zone of a DateTime from an IANA time zone identifier. If the time zone is invalid, an IllegalArgumentError will be thrown.

Example (Setting named time zones unsafely)

import { DateTime, Effect } from "effect"

Effect.gen(function*() {
  const now = yield* DateTime.now
  // set the time zone
  DateTime.setZoneNamedUnsafe(now, "Europe/London")
})

Signature

declare const setZoneNamedUnsafe: { (zoneId: string, options?: { readonly adjustForTimeZone?: boolean | undefined; readonly disambiguation?: Disambiguation | undefined; }): (self: DateTime) => Zoned; (self: DateTime, zoneId: string, options?: { readonly adjustForTimeZone?: boolean | undefined; readonly disambiguation?: Disambiguation | undefined; }): Zoned; }

Source

Since v4.0.0