Format time in long format in Java
Description
The following code shows how to format time in long format.
Example
//from w w w . ja va2 s.c o m
import java.text.DateFormat;
import java.util.Date;
public class Main {
public static void main(String args[]) {
Date date = new Date();
DateFormat df = DateFormat.getTimeInstance(DateFormat.LONG);
System.out.println("Long form: " + df.format(date));
}
}
The code above generates the following result.