Date Month name and number format(%tB %tb %tm)


import java.util.Calendar;
import java.util.Formatter;

public class MainClass {
  public static void main(String args[]) {
    Formatter fmt = new Formatter();
    Calendar cal = Calendar.getInstance();

    fmt = new Formatter();
    fmt.format("%tB %tb %tm", cal, cal, cal);
    System.out.println(fmt);
  }
}

Output:


June Jun 06
Home 
  Java Book 
    Runnable examples  

Formatter:
  1. Date Complete time and date format(%tc)
  2. Date hour and minute format(%tl:%tM)
  3. Date Month name and number format(%tB %tb %tm)
  4. Date Standard 12-hour time format(%tr)