Android Calendar String Parse stringToCalendar(String date)

Here you can find the source of stringToCalendar(String date)

Description

string To Calendar

Declaration

public static Calendar stringToCalendar(String date) 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Main {
    public static Calendar stringToCalendar(String date) {
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat dateformatter = new SimpleDateFormat(
                "dd/MM/yyyy HH:mm:ss");
        try {/*  ww w  .  j  av  a2 s  .  co  m*/
            calendar.setTime(dateformatter.parse(date));
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return calendar;
    }
}

Related

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