Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.Clock;
import java.time.LocalDateTime;

public class Main {
    public static void main(String[] args) {
        // Current Time
        Clock clock = Clock.systemUTC();
        System.out.println(Clock.systemDefaultZone());

        LocalDateTime dateAndTime = LocalDateTime.now(clock);
        System.out.println(dateAndTime);
        System.out.println(LocalDateTime.now());

    }
}