ZoneOffset UTC example

Description

ZoneOffset UTC defines the time-zone offset for UTC, with an ID of 'Z'.

Syntax

UTC has the following syntax.


public static final ZoneOffset UTC

Example

The following example shows how to use UTC.


import java.time.ZoneOffset;
/*from  w w  w .  j  a v  a2s .  c o  m*/
public class Main {
  public static void main(String[] args) {
    ZoneOffset z = ZoneOffset.UTC;
    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