DateFormatDemo.java Source code

Java tutorial

Introduction

Here is the source code for DateFormatDemo.java

Source

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

class DateFormatDemo {
    public static void main(String args[]) {
        Date date = new Date();
        DateFormat df = DateFormat.getTimeInstance(DateFormat.LONG);
        System.out.println("Long form: " + df.format(date));
    }
}