Java Date Time - OffsetTime of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) example








OffsetTime of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) creates an instance of OffsetTime from an hour, minute, second and nanosecond.

Syntax

of has the following syntax.

public static OffsetTime of(int hour,   
                            int minute,   
                            int second,   
                            int nanoOfSecond,   
                            ZoneOffset offset)




Example

The following example shows how to use of.

import java.time.OffsetTime;
import java.time.ZoneOffset;
//w  ww.  java2s.  com
public class Main {
  public static void main(String[] args) {
    OffsetTime m = OffsetTime.of(12,12,123,1233,ZoneOffset.UTC);

    System.out.println(m);

  }
}