Format Month in MMM format like Jan, Feb etc in Java
Description
The following code shows how to format Month in MMM format like Jan, Feb etc.
Example
/*from w ww . ja v a 2 s .c o m*/
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] args) {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("MMM");
System.out.println("Current Month in MMM format : " + sdf.format(date));
}
}
The code above generates the following result.