Java Year Month getYearMonth(Date date)

Here you can find the source of getYearMonth(Date date)

Description

get Year Month

License

Open Source License

Declaration

static public int getYearMonth(Date date) throws ParseException 

Method Source Code

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

import java.text.ParseException;

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

public class Main {
    static public int getYearMonth(Date date) throws ParseException {
        Calendar c = Calendar.getInstance();
        c.setTime(date);/*from w  w w.j a va  2 s .c  o m*/
        return (c.get(Calendar.YEAR)) * 100 + c.get(Calendar.MONTH) + 1;
    }
}

Related

  1. getYearAndMonth()
  2. getYearMonth()
  3. getYearMonth()
  4. getYearMonth(Calendar sDate)
  5. getYearMonth(Date date)
  6. getYearMonth(String dateString)
  7. getYearMonth(String year)
  8. getYearMonthDate()
  9. getYearMonthDateByMisSecond(long misSecond)