List of utility methods to do Date String to Date Convert
Calendar | parseCalDav(String date) parse Cal Dav if (date == null || date.equals("")) return null; GregorianCalendar temp = new GregorianCalendar(); temp.setTime(caldavFormat.parse(date)); return temp; |
Calendar | parseCalDavDue(String date) parse Cal Dav Due return parseDate(date, caldavDueFormat);
|
Calendar | parseDBDateTime(String date) parse DB Date Time return parseDate(date, dbDateTimeFormat);
|
Calendar | parseDate(String date) parse Date return parseDate(date, dateFormat);
|
Calendar | parseDate(String date, SimpleDateFormat format) parse Date if (date == null || date.equals("")) return null; GregorianCalendar temp = new GregorianCalendar(); temp.setTime(format.parse(date)); return temp; |
Date | parseDate(String dateString) parse Date, "yyyy-MM-dd HH:mm" SimpleDateFormat sdf = new SimpleDateFormat( FORMAT_DATE_AND_TIME_YYYY_MM_DD_HH_MM); try { return sdf.parse(dateString); } catch (Exception e) { e.printStackTrace(); return null; |
Calendar | parseDateTime(String date) parse Date Time return parseDate(date, dateTimeFormat);
|
Calendar | parseTaskWarrior(String date) parse Task Warrior return parseDate(date, taskwarriorFormat);
|
Date | getDate(String sDate, String dateFormat) get Date SimpleDateFormat fmt = new SimpleDateFormat(dateFormat); ParsePosition pos = new ParsePosition(0); return fmt.parse(sDate, pos); |
Date | convertStringToDate(String dateString, String currentFormat) used to convert the specified date string to Date instance SimpleDateFormat dateFormat = new SimpleDateFormat(currentFormat, Locale.getDefault()); return dateFormat.parse(dateString); |