Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.OffsetTime;
import java.time.ZoneOffset;

public class Main {
    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);

    }
}