Java Month Get getMonth()

Here you can find the source of getMonth()

Description

get Month

License

Open Source License

Declaration

public static String getMonth() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static String getMonth() {
        Calendar calendar = new GregorianCalendar();
        int m = calendar.get(GregorianCalendar.MONTH);
        switch (m) {
        case 0:/*from  ww  w.j ava2  s . c o  m*/
            return "Jenuary";
        case 1:
            return "February";
        case 2:
            return "March";
        case 3:
            return "April";
        case 4:
            return "May";
        case 5:
            return "June";
        case 6:
            return "July";
        case 7:
            return "August";
        case 8:
            return "September";
        case 9:
            return "October";
        case 10:
            return "November";
        case 11:
            return "December";
        }
        return null;
    }
}

Related

  1. getMonth()
  2. getMonth()
  3. getMonth()
  4. getMonth()
  5. getMonth()
  6. getMonth()
  7. getMonth()
  8. getMonth(Date d)
  9. getMonth(Date date)