Stdlib index
- Captured-borrow migration worklist (3.3.3)
- Owned-bind migration worklist (8.2.7)
- Return-side title audit — the ride-through enumeration
- stdlib ownership audit
- stdlib ownership dispositions (plan 1.3.1 / 4.3.1)
codec
codec / csv
codec / json
collection
- ArrayList
- BPlusTree
- Cache
- Collectors
- HashMap
- HashSet
- Heap
- ImmutableList
- ImmutableMap
- ImmutableSet
- LinkedList
- RedBlackTree
- Sort
collection / ltm
concurrent
error
gfx
hash
ifx
io
io / file
io / net
io / net / dns
io / net / tls
io / net / uri
lang
lang / stream
math
math / fft
math / linalg
math / npio
math / poly
math / random
math / stats
nucleo
- Columns — the Arrow-laid-out substrate
- Fused tensor expressions — Fuse
- Table — the lazy, typed dataframe
- Tape — define-by-run autograd
- Transform intrinsics — Grad, Vmap, Jit
process
reflect
search / distance
search / fuzzy
search / ngram
session
time
- Clock
- DateTimeFormatter
- Duration
- Instant
- LocalDate
- LocalDateTime
- LocalTime
- Period
- ZonedDateTime
- ZoneId
- ZoneOffset
wire
xpu
xpu / mesh
ZoneId
cajeta.time.ZoneId — a geographical/region time-zone identifier (e.g.
America/Los_Angeles, Europe/Paris, UTC), modeled on the region subset of
java.time.ZoneId. Unlike a fixed ZoneOffset, a ZoneId maps
to different offsets at different instants — it honours daylight-saving
transitions. Offsets are resolved against the system tz database
(/usr/share/zoneinfo); UTC / GMT / Z / Etc/UTC resolve to a zero
offset without touching the filesystem, and any other unknown or unavailable
zone makes offsetAt throw DateTimeException. Unlike the package’s value
types it is a reference object, created with ZoneId.of(...).
ZoneId utc #= ZoneId.of("UTC");
Instant t0 = Instant.ofEpochSecond(1000L);
ZoneOffset off = utc.offsetAt(t0); // +00:00
ZonedDateTime zdt = utc.resolve(t0);
Methods
| Signature | |
|---|---|
ZoneId(String id) | Wraps a raw IANA id; prefer the of factory |
static #ZoneId of(String id) ⚑ | The zone with the given IANA id |
static #ZoneId utc() ⚑ | The UTC zone; always resolves to a zero ZoneOffset without touching the tz database |
String getId() | The IANA id string this zone was created with |
ZoneOffset offsetAt(Instant instant) | The UTC offset in effect in this zone at instant (DST-aware) |
ZonedDateTime resolve(Instant instant) | The ZonedDateTime for instant observed in this zone |
⚑ = @EntryPoint
See also
- Tour: TimeDemo
- Source:
runtime/src/cajeta/time/ZoneId.cajeta - ZoneOffset, ZonedDateTime, Instant