List of utility methods to do Date Format As
String | fmtTime(Date time) fmt Time return fmtTime(time, "yyyy-MM-dd HH:mm:ss"); |
String | formatDateAccordingToSessionDuration(Calendar cal, int sessionDuration, int offset) format Date According To Session Duration long time = cal.getTimeInMillis(); long minutes = (time / (1000 * 60)); int diff = (int) (minutes % sessionDuration); diff = diff - offset; if (diff < 0) diff += sessionDuration; time = (minutes - diff) * 1000 * 60; return df.format(new Date(time)); ... |
String | formatDateAppello(Date data) format Date Appello SimpleDateFormat dateFormat = new SimpleDateFormat(DD_MM_YYYY); return dateFormat.format(data); |
String | formatDateAsFileSystemName() Returns a date formatted in the standard syncvoice format final Date date = createDate(); return formatDate(date, "yyyy-MM-dd_HH-mm-ss"); |
String | formatDateAsYYYYMMDD(Date date) Format a date as yyyy-MM-dd. if (date == null) { return ""; } else { return yyyyMMddFormatter.format(date); |
String | formatDateBdChar(Date birthdate) format Date Bd Char return birthdate != null ? datetimeFormatBdChar.format(birthdate) : null;
|
String | formatDateByDefault(Date date) format Date By Default if (null == date) { return null; DateFormat df = new SimpleDateFormat(PATTERN_DEFAULT); String dateStr = df.format(date); return dateStr; |
String | formatDateByYYYYMMDDHHmmss(Date date) This method is used for formatting date to yyyyMMddHHmmss SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern("yyyyMMddHHmmss"); return sdf.format(date); |
String | formatDateCkan(Date date) format Date Ckan String formattedDate = null; if (date != null) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); df.setTimeZone(TimeZone.getTimeZone("UTC")); formattedDate = df.format(date); return formattedDate; |
String | formatDateDashes(Date oDate) Format a date with dashes. String sDate = ""; if (oDate != null) { SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy"); sDate = format.format(oDate); return sDate; |