List of utility methods to do Date Parse
Date | convertStringToDate(String dateString, String dateFormat) Method converts a String to Date, format of the String should be specified Example: dateString: 1999-10-15 dateFormat: yyyy-mm-dd if (isStringBlank(dateString) || isStringBlank(dateFormat)) { return null; DateFormat df = new SimpleDateFormat(dateFormat); try { Date dateObject = df.parse(dateString); return dateObject; } catch (ParseException e) { ... |
Date | convertStringToDate(String dateString, String pattern) convert String To Date SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.parse(dateString); |
Date | convertStringToDate(String dateText) convert String To Date DateFormat dateFormat = new SimpleDateFormat(); try { return dateFormat.parse(dateText); } catch (ParseException x) { throw new RuntimeException("Unable to parse string [" + dateText + "] into date.", x); |
Date | convertStringToDate(String dateTime) Converts a datetime string into and instance of java.util.Date using the date format: yyyy-MM-ddTHH:mm:ss.SSSZ. return parseDateLoose(dateTime);
|
Date | convertStringToDate(String dateTime) Converts a datetime string into and instance of java.util.Date using the date format: yyyy-MM-ddTHH:mm:ss.SSSZ. return parseDateAsUTC(dateTime);
|
Date | convertStringToDate(String dt) convert String To Date if (dt == null || dt.equals("")) { return null; return convertStringToDate("yyyy-MM-dd", dt); |
Date | convertStringToDate(String input) convert String To Date SimpleDateFormat formatter = new SimpleDateFormat(DATEFORMAT); Date date = null; try { date = formatter.parse(input); } catch (ParseException e) { e.printStackTrace(); return date; ... |
Date | convertStringToDate(String s) convert String To Date try { SimpleDateFormat dateformat1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date d; d = dateformat1.parse(s); return d; } catch (ParseException e) { try { ... |
Date | convertStringToDate(String str) convert String To Date Date returnDate = null; DateFormat df = new SimpleDateFormat("MM/dd/yyyy"); try { if (str != null) { returnDate = df.parse(str); } catch (ParseException pe) { returnDate = new Date(); ... |
Date | convertStringToDate(String str, String pattern) convert String To Date SimpleDateFormat sdf = null; try { sdf = new SimpleDateFormat(pattern); } catch (Exception ex) { sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { return sdf.parse(str); ... |