Android Calendar Parse getSelectCalendar(String dateStr, String pattern)

Here you can find the source of getSelectCalendar(String dateStr, String pattern)

Description

get Select Calendar

Declaration

public static Calendar getSelectCalendar(String dateStr, String pattern)
            throws ParseException 

Method Source Code

//package com.java2s;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Calendar getSelectCalendar(String dateStr, String pattern)
            throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat(pattern);

        Date date = formatter.parse(dateStr);
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from ww w.ja v a 2s . c o  m*/
        return calendar;

    }
}

Related

  1. pars2Calender(String s)
  2. stringToCalendar(String date)
  3. convertStringToCalendar(String stringDate)
  4. getCalendarFromString(String time)
  5. getDesignatedCalendar(String unformattedTime)