Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;

public class Main {
    public static void main(String[] args) {
        ZoneId berlin = ZoneId.of("Europe/Berlin");

        // 2014-02-20 12:00
        LocalDateTime dateTime = LocalDateTime.of(2014, 02, 20, 12, 0);

        // 2014-02-20 12:00, Europe/Berlin (+01:00)
        ZonedDateTime berlinDateTime = ZonedDateTime.of(dateTime, berlin);

        System.out.println(berlinDateTime);
    }
}