(self: Zoned): stringFormats the time zone offset of a DateTime.Zoned as an ISO string.
Details
The offset is formatted as "±HH:MM".
Example (Formatting zoned offsets)
import { DateTime } from "effect"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
timeZone: DateTime.zoneMakeOffset(3 * 60 * 60 * 1000) // +3 hours
})
const offsetString = DateTime.zonedOffsetIso(zoned)
console.log(offsetString) // "+03:00"converting
Source effect/DateTime.ts:16331 lines
export const const zonedOffsetIso: (
self: Zoned
) => string
Formats the time zone offset of a DateTime.Zoned as an ISO string.
Details
The offset is formatted as "±HH:MM".
Example (Formatting zoned offsets)
import { DateTime } from "effect"
const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
timeZone: DateTime.zoneMakeOffset(3 * 60 * 60 * 1000) // +3 hours
})
const offsetString = DateTime.zonedOffsetIso(zoned)
console.log(offsetString) // "+03:00"
zonedOffsetIso: (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) => string = import InternalInternal.const zonedOffsetIso: (
self: DateTime.Zoned
) => string
zonedOffsetIso