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) {
        SimpleDateFormat sdfDate = new SimpleDateFormat("dd/MM/yyyy");

        Date now = new Date();

        String strDate = sdfDate.format(now);

        System.out.println("Date: " + strDate);
    }
}
//Date: 18/02/2009