List of utility methods to do Date Format As
String | formatDateDay(final Date date) format Date Day return new SimpleDateFormat("yyyy-MM-dd").format(date); |
String | formatDateForCompleteInfo(Date date) Formats a date holding all provided info. return fullDate.format(date);
|
String | formatDateForGMT(Date moonDate) Useful date-to-string formatting which I found myself using a lot DateFormat sdf = SimpleDateFormat.getDateInstance(SHORT); ((SimpleDateFormat) sdf).applyPattern("yyyy-MM-dd"); ((SimpleDateFormat) sdf).setTimeZone(TimeZone.getTimeZone("GMT")); return sdf.format(moonDate); |
String | formatDateForLogFileName(Date date) format Date For Log File Name DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return dateFormat.format(calendar.getTime()); |
String | formatDateForTAP(Date date) Utility class that help us to build date strings that can be used in TAP data provider return new SimpleDateFormat("dd.MM.yyyy").format(date); |
String | formatDateForXpath(Date date) format Date For Xpath return "xs:dateTime('" + getXpathFormattedDate(date) + 'T' + getXpathFormattedTime(date) + getTimeZone(date) + "')"; |
String | formatDateGMT(Date date) format Date GMT return DateFormat.getDateInstance(DateFormat.SHORT).format(date);
|
String | formatDateHeader(final Date date) format Date Header Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.setTimeZone(TimeZone.getTimeZone("GMT")); return new SimpleDateFormat(DATE_HEADER_FMT).format(date) + GMT_SUFFIX; |
String | formatDateHeader(final Date date) format Date Header return new SimpleDateFormat(DATE_HEADER_FMT).format(date); |
String | formatDateHMS(java.util.Date date) format Date HMS String result = ""; if (date != null) { try { SimpleDateFormat dateFormater = new SimpleDateFormat("HH:mm:ss"); result = dateFormater.format(date); } catch (Exception ex) { ex.printStackTrace(); return result; |