Skip to main content

ZonedDateTime

  • Stability: stable
  • Since: 0.1.0

Combines an absolute instant with an IANA time zone so calendar fields can be interpreted consistently.

  • Qualified id: com.dataspine.datetime.ZonedDateTime@1
  • Kind: struct

Properties

NameTypeDescription
epoch_millisInteger64Milliseconds since 1970-01-01T00:00:00Z.
timezoneStringIANA time zone name.
nanosecondInteger32Nanosecond fraction within the represented second.

Static methods

of

  • Stability: stable

Interprets the wall-clock fields in the given IANA zone, resolves the UTC instant using that zone's rules (including DST), and stores subsecond precision from that resolution.

of(local_date_time: LocalDateTime, timezone: TimeZone): ZonedDateTime

Parameters

NameTypeDescription
local_date_timeLocalDateTimeWall-clock fields without zone context.
timezoneTimeZoneIANA zone applied to the civil fields.

Return type

ZonedDateTime

parse

  • Stability: stable

Parses zone-aware ISO-style text: RFC 3339–like timestamps with Z or numeric offsets, optional fractional seconds, and extended forms that include an IANA zone name where the runtime accepts them.

parse(iso_string: String): ZonedDateTime

Parameters

NameTypeDescription
iso_stringStringISO-8601 string representing an instant with zone information.

Return type

ZonedDateTime

Methods

dayOfMonth

  • Stability: stable

Projects the instant into the stored zone and reads the day of month.

dayOfMonth(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

dayOfWeek

  • Stability: stable

Returns the ISO weekday (Monday = 1 … Sunday = 7) for the wall-clock projection in the stored zone.

dayOfWeek(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

dayOfYear

  • Stability: stable

Ordinal day of year (1–366) for the wall-clock date in the stored zone.

dayOfYear(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

format

  • Stability: stable

Formats the wall-clock projection in the stored zone using POSIX-style % directives (see types module docs). Failures return DateTimeError in the optional slot.

format(pattern: String): String

Parameters

NameTypeDescription
patternStringstrftime-style format string: literals plus % conversion specifiers (see types module docs).

Return type

String

hour

  • Stability: stable

Projects the instant into the stored zone and reads the hour.

hour(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

minute

  • Stability: stable

Projects the instant into the stored zone and reads the minute.

minute(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

month

  • Stability: stable

Projects the instant into the stored zone and reads the month.

month(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

second

  • Stability: stable

Projects the instant into the stored zone and reads the second.

second(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

timezone

  • Stability: stable

Wraps the stored zone name in a TimeZone struct for further DSL calls.

timezone(): TimeZone

Parameters

This function does not take any parameters.

Return type

TimeZone

toInstant

  • Stability: stable

Discards calendar projection while preserving the absolute millisecond timeline position.

toInstant(): Instant

Parameters

This function does not take any parameters.

Return type

Instant

toIsoString

  • Stability: stable

Returns the canonical zone-aware text for this value (offset or Z, optional bracketed IANA name, fractional seconds when present), as produced by the datetime runtime.

toIsoString(): String

Parameters

This function does not take any parameters.

Return type

String

toLocalDateTime

  • Stability: stable

Projects the stored absolute instant into wall-clock fields in the stored IANA zone, then returns those fields as a zone-less LocalDateTime.

toLocalDateTime(): LocalDateTime

Parameters

This function does not take any parameters.

Return type

LocalDateTime

withTimezone

  • Stability: stable

Keeps the absolute millisecond timeline position but recomputes zoned calendar fields using the new zone rules.

withTimezone(timezone: TimeZone): ZonedDateTime

Parameters

NameTypeDescription
timezoneTimeZoneReplacement IANA zone to apply to this instant.

Return type

ZonedDateTime

year

  • Stability: stable

Projects the instant into the stored zone and reads the year; invalid zone or instant data surfaces as DateTimeError in the optional slot.

year(): Integer32

Parameters

This function does not take any parameters.

Return type

Integer32

Back to Datetime