List of utility methods to do Date Create
Date | toDate(Object value) to Date String stringValue = String.valueOf(value); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); return dateFormat.parse(stringValue); |
String | toDateFormat(Date date) Returns a string in standard PDF date format representing the specified date (in the default timezone). Calendar c = Calendar.getInstance();
c.setTime(date);
return toPDFDateFormat(c);
|
Date | toDateFromLong(Long time) to Date From Long try { SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String str = formatter.format(time); Date date = formatter.parse(str); return date; } catch (ParseException e) { e.printStackTrace(); return null; ... |
String | toDateHeader(long value) to Date Header final SimpleDateFormat[] formats = DATE_FORMATS.get(); return formats[0].format(new Date(value)); |
String | toDateList(Collection extends Date> list) Converts a collection of values to an R compatible list. return toDateList(list, "''yyyy-MM-dd''"); |
String | toDateQueryFormat(Date value) Transforms a Date instance into a String using the default date parser. return new SimpleDateFormat(ISO8601_FMT).format(value); |
String | toDateStr(Date d) to Date Str if (d == null) { return null; String ret = null; try { ret = new SimpleDateFormat(IOS_DATE_FORMAT).format(d); } catch (Exception e) { ret = new SimpleDateFormat(IOS_DATE_FORMAT_OLD).format(d); ... |
String | ToDateStr(Date dt) To Date Str if (dt == null) return ""; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.format(dt); |
String | toDateStr(Object o) to Date Str return o == null ? null : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format((Date) o); |
String | toDateText(Date date) to Date Text return toDateText(date, DATE_FORMAT);
|