Java Year Month getYearMonth(String dateString)

Here you can find the source of getYearMonth(String dateString)

Description

get Year Month

License

Open Source License

Declaration

public static Date getYearMonth(String dateString) 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date getYearMonth(String dateString) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
        Date date;//  w  w w. j  av a  2  s .c  o  m
        try {
            date = sdf.parse(dateString);
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
        return date;
    }
}

Related

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