Here you can find the source of getMonth(Integer month)
Parameter | Description |
---|---|
month | month number, starting 0 |
public static String getMonth(Integer month)
//package com.java2s; //License from project: Open Source License import java.text.DateFormatSymbols; import java.util.*; public class Main { /**/*w w w. j ava2s. c o m*/ * Gets Name of the month by its number * * @param month month number, starting 0 * @return number of month in a year starting 0 */ public static String getMonth(Integer month) { return new DateFormatSymbols().getMonths()[month]; } /** * Returns month number starting 0 * * @param month month name, e.g. November * @return number of month in a year starting 0 */ public static Integer getMonth(String month) { return Arrays.asList(new DateFormatSymbols().getMonths()).indexOf(month); } }