Example usage for java.time OffsetTime of

List of usage examples for java.time OffsetTime of

Introduction

In this page you can find the example usage for java.time OffsetTime of.

Prototype

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

Source Link

Document

Obtains an instance of OffsetTime from an hour, minute, second and nanosecond.

Usage

From source file:Main.java

public static void main(String[] args) {
    OffsetTime m = OffsetTime.of(12, 12, 123, 1233, ZoneOffset.UTC);

    System.out.println(m);

}

From source file:Main.java

public static void main(String[] args) {
    // current offset time
    OffsetTime ot1 = OffsetTime.now();
    System.out.println("Current  offset  time: " + ot1);

    // a zone offset +01:30
    ZoneOffset offset = ZoneOffset.ofHoursMinutes(1, 30);

    OffsetTime offsetTime = OffsetTime.of(16, 40, 28, 0, offset);
    System.out.println(offsetTime);

}