Java Program to get Month Name


This Java example will show you how to get Month Name. Month name in MMMM Format by using SimpleDateFormat('MMMM') class with format(date) method

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("MMMM");
      System.out.println("Current Month in MMMM format : " + sdf.format(date));
   }
}

 

 

Output:

Current Month in MMMM format : May


JAVA File IO examples

JAVA Date & Time Progamming Examples