List of utility methods to do Date from String
Date | convertToDate(String str, String format) convert To Date SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); return simpleDateFormat.parse(str); |
Date | convertToDate(String strDate, String format) convert To Date if (strDate == null || format == null) { return null; Date date = null; SimpleDateFormat sdf = new SimpleDateFormat(format); try { date = sdf.parse(strDate.trim()); } catch (ParseException e) { ... |
Date | convertToDate(String strDate, String format) convert To Date SimpleDateFormat sf = new SimpleDateFormat(format); return sf.parse(strDate); |
Date | convertToDate(String val) convert To Date return convertToDate(val, "yyyy-MM-dd"); |
Date | convertToDate(String value) convert To Date if (value == null) return null; value = value.trim(); if (value.length() == 0) return null; Date date = null; try { date = FMT.parse(value); ... |
Date | convertToDateTimeNoSec(String date) convert To Date Time No Sec DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm"); return df.parse(date); |
String | convertToDateTimeString(Date d1) convert To Date Time String DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); df.setTimeZone(TimeZone.getTimeZone("GMT")); String dString = df.format(d1); return dString; |
String | convertToDateWithTimeString(Date date) Formats a date return DATE_WITH_TIME_FORMATTER.format(date);
|
Date | getDateFromPattern(String pattern) get Date From Pattern return getDateFromPattern(pattern, new Date(System.currentTimeMillis())); |
Date | getDateFromReccurenceInterval(int reqDOW, int reqDOM, int time) get Date From Reccurence Interval Date result;
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DAY_OF_WEEK, reqDOW);
cal.set(Calendar.DAY_OF_MONTH, reqDOM);
cal.set(Calendar.HOUR_OF_DAY, time);
result = cal.getTime();
return result;
|