Android Calendar Parse getCalendarFromString(String time)

Here you can find the source of getCalendarFromString(String time)

Description

get Calendar From String

Declaration

public static Calendar getCalendarFromString(String time) 

Method Source Code

//package com.java2s;
import java.util.Calendar;

public class Main {
    public static Calendar getCalendarFromString(String time) {
        String[] timeParts = time.split(":");
        int hour = Integer.parseInt(timeParts[0]);
        int minute = Integer.parseInt(timeParts[1]);
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, hour);
        calendar.set(Calendar.MINUTE, minute);
        return calendar;
    }//from  w  w  w  . jav a 2 s  .c  om
}

Related

  1. pars2Calender(String s)
  2. stringToCalendar(String date)
  3. convertStringToCalendar(String stringDate)
  4. getSelectCalendar(String dateStr, String pattern)
  5. getDesignatedCalendar(String unformattedTime)