List of utility methods to do Calendar Parse
Calendar | toCalendar(String str) to Calendar Calendar cal = new GregorianCalendar(); Date date = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); try { date = sdf.parse(str); cal.setTime(date); } catch (Exception e) { e.printStackTrace(); ... |
GregorianCalendar | toGregorianCalendar(String value) to Gregorian Calendar Date d = new SimpleDateFormat().parse(value); GregorianCalendar gc = new GregorianCalendar(); gc.setTime(d); return gc; |
Calendar | toLocalCustomFormatCalendar(String calString, String format) to Local Custom Format Calendar Calendar localCal = Calendar.getInstance(); localCal.setTime(new SimpleDateFormat(format).parse(calString)); return localCal; |