Java SQL Date getMonthInt(String month)

Here you can find the source of getMonthInt(String month)

Description

Return month in int representation from String .

License

Apache License

Parameter

Parameter Description
month a parameter

Return

month in int representation

Declaration

public static int getMonthInt(String month) 

Method Source Code

//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();
    }
}

Related

  1. getFirstDayOfThisMonth()
  2. getInsertarEmpleado()
  3. getInsertarEntrada()
  4. getIntervalDays(String sd, String ed)
  5. getLastDay()
  6. getNextDayStr(String curday)
  7. getNextDayStr(String curday)
  8. getNow()
  9. getNow()