Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static void main(String[] args) {
        Date d = new Date();
        SimpleDateFormat sd = new SimpleDateFormat("MMMM dd, YYYY");
        SimpleDateFormat sd1 = new SimpleDateFormat("HH:mm");

        String s = sd.format(d);
        String s1 = sd1.format(d);

        System.out.println(s + " " + s1);
    }
}