Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.Duration;
import java.time.Period;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class Main {

    public static void main(String[] args) {

        ZonedDateTime _130AMChicagoTime = ZonedDateTime.of(2014, 3, 9, 1, 30, 0, 0, ZoneId.of("America/Chicago"));

        System.out.println(_130AMChicagoTime.plusHours(3));
        System.out.println(_130AMChicagoTime.plus(Duration.ofHours(3)));

        System.out.println(_130AMChicagoTime.plus(Duration.ofDays(2)));
        System.out.println(_130AMChicagoTime.plus(Period.ofDays(2)));
    }
}