Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class Main {
    public static void main(String[] argv) {
        String ldStr = DateTimeFormatter.ISO_DATE.format(LocalDate.now());
        System.out.println(ldStr);
        String odtStr = DateTimeFormatter.ISO_DATE.format(OffsetDateTime.now());
        System.out.println(odtStr);
        String zdtStr = DateTimeFormatter.ISO_DATE.format(ZonedDateTime.now());
        System.out.println(zdtStr);
    }
}