effect-io-ai

Package: effect
Module: DateTime

DateTime.setZoneNamed

Set the time zone of a DateTime from an IANA time zone identifier. If the time zone is invalid, None will be returned.

Example

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>; }

Source

Since v3.6.0