On this page
  1. ZonedDateTime
  2. Import
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

ZonedDateTime

Prev: `LocalDate` | Up: java.time | Next: `Duration`
Rel: java.time, java/builtins
Ref: Java Docs — ZonedDateTime
Tags: #public #prog #java #stdlib #java_time #tier/standard


Import

import java.time.*;

Signature & Overview

ZonedDateTime.now(ZoneId.of("America/Los_Angeles"))

Date-time with full IANA time-zone and Daylight Saving Time rules.

Notes & Pitfalls

Example

import java.time.*;

var zdt = Instant.parse("2026-07-01T19:00:00Z").atZone(ZoneId.of("America/Los_Angeles"));
assert zdt.getHour() == 12;

Linked from

Related notes