Android Calendar String Parse getAsCalendar(String dateString)

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

Description

get As Calendar

Declaration

public static Calendar getAsCalendar(String dateString)
            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 {
    private static SimpleDateFormat df = new SimpleDateFormat(
            "dd-MM-yyyy HH:mm");

    public static Calendar getAsCalendar(String dateString)
            throws ParseException {
        Calendar date = Calendar.getInstance();
        date.setTime((Date) df.parse(dateString));
        return date;
    }/* ww w .j a v a2  s . c om*/
}

Related

  1. fromString(String dateString, String format)
  2. parseCalendar(int year, int month, double day, TimeZone zone)
  3. parseCalendar(int year, int month, int day, int hour, int minute, int second, int millisecond, TimeZone zone)
  4. parseDA(Calendar c, String s, int off, int len)
  5. parseTM(Calendar c, String s, int off, int len)
  6. getCalendarFromString(final String date)
  7. stringToCalendar(String date)