ZoneOffset getId() example

Description

ZoneOffset getId() gets the normalized zone offset ID.

Syntax

getId has the following syntax.


public String getId()

Example

The following example shows how to use getId.


import java.time.ZoneOffset;
//www .ja  v a2 s  .  co m
public class Main {
  public static void main(String[] args) {
    ZoneOffset z = ZoneOffset.UTC;
    String t = z.getId();
    System.out.println(t);
  }
}

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