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








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

Syntax

ofHoursMinutesSeconds has the following syntax.

public static ZoneOffset ofHoursMinutesSeconds(int hours,     int minutes,     int seconds)

Example

The following example shows how to use ofHoursMinutesSeconds.

import java.time.ZoneOffset;

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

The code above generates the following result.