Java Year Month getYearMonth(Calendar sDate)

Here you can find the source of getYearMonth(Calendar sDate)

Description

get Year Month

License

Open Source License

Declaration

public static String getYearMonth(Calendar sDate) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static String getYearMonth(Calendar sDate) {
        if (sDate == null)
            return "";
        return (new java.text.SimpleDateFormat("yyyy-MM")).format(sDate
                .getTime());/*from ww w  . j  ava 2s .c  o m*/
    }
}

Related

  1. getThisYearMonth()
  2. getTimeByYearMonth(String yearMonth, String timeZone)
  3. getYearAndMonth()
  4. getYearMonth()
  5. getYearMonth()
  6. getYearMonth(Date date)
  7. getYearMonth(Date date)
  8. getYearMonth(String dateString)
  9. getYearMonth(String year)