MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class MainClass {
    public static void main(String[] args) {
        Date today = new Date();
        DateFormat fmt = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US);
        String formatted = fmt.format(today);
        System.out.println(formatted);
    }
}