Java Date Time - ZoneOffset ofHoursMinutes(int hours, int minutes) example








ZoneOffset ofHoursMinutes(int hours, int minutes) creates an instance of ZoneOffset using an offset in hours and minutes.

Syntax

ofHoursMinutes has the following syntax.

public static ZoneOffset ofHoursMinutes(int hours,    int minutes)

Example

The following example shows how to use ofHoursMinutes.

import java.time.ZoneOffset;

public class Main {
  public static void main(String[] args) {
    ZoneOffset t = ZoneOffset.ofHoursMinutes(1,20);
    System.out.println(t);
  }
}

The code above generates the following result.