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
| Name | Type | Description |
|---|---|---|
epoch_millis | Integer64 | Milliseconds since 1970-01-01T00:00:00Z. |
timezone | String | IANA time zone name. |
nanosecond | Integer32 | Nanosecond 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
| Name | Type | Description |
|---|---|---|
local_date_time | LocalDateTime | Wall-clock fields without zone context. |
timezone | TimeZone | IANA zone applied to the civil fields. |
Return type
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
| Name | Type | Description |
|---|---|---|
iso_string | String | ISO-8601 string representing an instant with zone information. |
Return type
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
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
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
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
| Name | Type | Description |
|---|---|---|
pattern | String | strftime-style format string: literals plus % conversion specifiers (see types module docs). |
Return type
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
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
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
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
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
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
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
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
withTimezone
- Stability:
stable
Keeps the absolute millisecond timeline position but recomputes zoned calendar fields using the new zone rules.
withTimezone(timezone: TimeZone): ZonedDateTime
Parameters
| Name | Type | Description |
|---|---|---|
timezone | TimeZone | Replacement IANA zone to apply to this instant. |
Return type
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.