(self: Zoned): numberComputes the time zone offset of a DateTime.Zoned in milliseconds.
Details
Returns the offset from UTC in milliseconds. Positive values indicate time zones ahead of UTC, negative values indicate time zones behind UTC.
Example (Reading zoned offsets)
import { DateTime } from "effect"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
timeZone: "Europe/London"
})
const offset = DateTime.zonedOffset(zoned)
console.log(offset) // 0 (London is UTC+0 in winter)converting
Source effect/DateTime.ts:16081 lines
export const const zonedOffset: (self: Zoned) => numberComputes the time zone offset of a DateTime.Zoned in milliseconds.
Details
Returns the offset from UTC in milliseconds. Positive values indicate
time zones ahead of UTC, negative values indicate time zones behind UTC.
Example (Reading zoned offsets)
import { DateTime } from "effect"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
timeZone: "Europe/London"
})
const offset = DateTime.zonedOffset(zoned)
console.log(offset) // 0 (London is UTC+0 in winter)
zonedOffset: (self: Zoned(parameter) self: {
_tag: "Zoned";
epochMilliseconds: number;
zone: TimeZone;
adjustedEpochMilliseconds: number | undefined;
partsAdjusted: DateTime.PartsWithWeekday | undefined;
partsUtc: DateTime.PartsWithWeekday | undefined;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: Zoned) => number = import InternalInternal.const zonedOffset: (
self: DateTime.Zoned
) => number
zonedOffset