Java Month of Year stringToMonth(String year, String month, boolean flag)

Here you can find the source of stringToMonth(String year, String month, boolean flag)

Description

string To Month

License

Open Source License

Declaration

public static Date stringToMonth(String year, String month, boolean flag) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

public class Main {

    public static Date stringToMonth(String year, String month, boolean flag) {
        if (year == null || month == null)
            return null;
        Calendar instance = Calendar.getInstance();
        if (flag) {
            instance.set(Integer.parseInt(year), Integer.parseInt(month) - 1, 1, 0, 0, 0);
        } else {//from w  w  w  .  j av a  2s .  c o  m
            instance.set(Integer.parseInt(year), Integer.parseInt(month), 1, 0, 0, 0);
        }
        return instance.getTime();
    }
}

Related

  1. isWeekEnd(int year, int month, int day)
  2. Month_Of_Year(String Date, int MonthCase)
  3. monthLength(int month, int year)
  4. newInstance(int year, int month, int day)
  5. sleepUntil(int year, int month, int day, int hour, int min, int sec)
  6. sumDayByYearMonth(int year, int month)
  7. year(int month, int day, int hour, int minute, int second)
  8. yearMonth()