ZoneId normalized() example

Description

ZoneId normalized() normalizes the time-zone ID, returning a ZoneOffset where possible.

Syntax

normalized has the following syntax.


public ZoneId normalized()

Example

The following example shows how to use normalized.


import java.time.ZoneId;
/* w w w  .ja  va 2 s  .  c om*/
public class Main {
  public static void main(String[] args) {
    ZoneId z = ZoneId.systemDefault();
    z = z.normalized();
    System.out.println(z);
  } 
}

The code above generates the following result.





















Home »
  Java Date Time »
    java.time Reference »




Clock
DayOfWeek
Duration
Instant
LocalDate
LocalDateTime
LocalTime
Month
MonthDay
OffsetDateTime
OffsetTime
Period
Year
YearMonth
ZonedDateTime
ZoneId
ZoneOffset