Hyperlinkv0.8.0-beta.28

DateTime

DateTime.setZoneconsteffect/DateTime.ts:940
(
  zone: TimeZone,
  options?: {
    readonly adjustForTimeZone?: boolean | undefined
    readonly disambiguation?: Disambiguation | undefined
  }
): (self: DateTime) => Zoned
(
  self: DateTime,
  zone: TimeZone,
  options?: {
    readonly adjustForTimeZone?: boolean | undefined
    readonly disambiguation?: Disambiguation | undefined
  }
): Zoned

Sets the time zone of a DateTime, returning a new DateTime.Zoned.

Example (Setting time zones)

import { DateTime, Effect } from "effect"

Effect.gen(function*() {
  const now = yield* DateTime.now
  const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")

  // set the time zone
  const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
})
time zones
Source effect/DateTime.ts:94010 lines
export const setZone: {
  (zone: TimeZone, options?: {
    readonly adjustForTimeZone?: boolean | undefined
    readonly disambiguation?: Disambiguation | undefined
  }): (self: DateTime) => Zoned
  (self: DateTime, zone: TimeZone, options?: {
    readonly adjustForTimeZone?: boolean | undefined
    readonly disambiguation?: Disambiguation | undefined
  }): Zoned
} = Internal.setZone
Referenced by 1 symbols