Here you can find the source of getMonthInt(String month)
Parameter | Description |
---|---|
month | a parameter |
public static int getMonthInt(String month)
//package com.java2s; //License from project: Apache License import java.sql.Date; import java.time.LocalDate; import java.time.Month; public class Main { /**/*from w ww .j ava 2 s . c o m*/ * Return month in {@code int} representation from {@code String}. * @param month * @return month in {@code int} representation */ public static int getMonthInt(String month) { return Integer.parseInt(month); } public static int getMonthInt(Date date) { Month month = getMonth(date); return month.getValue(); } public static Month getMonth(Date date) { LocalDate localDate = date.toLocalDate(); return localDate.getMonth(); } }