List of utility methods to do Date Parse
Date | getDateFromText(String dateStr) get Date From Text if (dateStr != null && (!dateStr.isEmpty())) { SimpleDateFormat formatter = new SimpleDateFormat(SIMULATOR_DATE_FORMAT); Date startDate = null; try { startDate = formatter.parse(dateStr); } catch (ParseException e) { e.printStackTrace(); } finally { ... |
String | getDateFromTimestamp(String time, String pattern) get Date From Timestamp String date = new SimpleDateFormat(pattern).format(new Date(Long.parseLong(time) * 1000)); return date; |
Date | getDateFromUPnP(String dateString) Creates a date time value from a string appropriate for UPnP (e.g., 2006-10-27 12:00:00). try { return upnpDate.parse(dateString); } catch (Exception e) { return null; |
Date | getDateFromUTC(String utcFormat) get Date From UTC SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss'Z'"); ParsePosition pos = new ParsePosition(0); Date strtodate = formatter.parse(utcFormat, pos); if (strtodate == null) { strtodate = new Date(); return strtodate; |