Java Date Time - ZoneOffset UTC example








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;

public class Main {
  public static void main(String[] args) {
    ZoneOffset z = ZoneOffset.UTC;
    System.out.println(z);
  }
}

The code above generates the following result.