Hyperlinkv0.8.0-beta.28

DateTime

DateTime.zoneMakeOffsetconsteffect/DateTime.ts:1041
(offset: number): TimeZone.Offset

Create a fixed offset time zone.

Details

The offset is specified in milliseconds from UTC. Positive values are ahead of UTC, negative values are behind UTC.

Example (Creating fixed-offset time zones)

import { DateTime } from "effect"

// Create a time zone with +3 hours offset
const zone = DateTime.zoneMakeOffset(3 * 60 * 60 * 1000)

const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
  timeZone: zone
})
time zones
export const zoneMakeOffset: (offset: number) => TimeZone.Offset = Internal.zoneMakeOffset
Referenced by 4 symbols