List of utility methods to do Time Format
String | getFormattedFileTime(File f, String format) get Formatted File Time try { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(f.lastModified()); SimpleDateFormat sdf = new SimpleDateFormat(format); return sdf.format(cal.getTime()); } catch (SecurityException ignored) { return ""; |
String | getFormattedTime() get Formatted Time DateFormat format = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); return format.format(new Date()); |
String | getFormattedTime(Date date) get Formatted Time SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss"); formatter.getCalendar().setTimeZone(TimeZone.getTimeZone("UTC")); return formatter.format(date); |
String | getFormattedTime(Date date) get Formatted Time assert date != null; SimpleDateFormat formatter = new SimpleDateFormat(DISPLAYED_FORMATTED_TIME); String formattedTime = formatter.format(date); return formattedTime; |
String | getFormattedTime(final Calendar calendar) Function to return formatted time SimpleDateFormat format = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); format.setTimeZone(TimeZone.getTimeZone("UTC")); return format.format(calendar.getTime()); |
String | getFormattedTime(final Date date) get Formatted Time if (date == null) { return null; return createSimpleFormat().format(date); |
String | getFormattedTimeFilesafe(long t) get Formatted Time Filesafe return dateFormattingFilesafe.format(new Date(t)); |
String | getFormattedTimeString(double s) get Formatted Time String int hours = (int) s; int minutes = (int) ((s - hours) * 60); double seconds = (s - hours) * 3600 - minutes * 60; if (s < 0) { minutes = -minutes; String ss = null; if (seconds < 10) { ss = "0" + fmt.format(-seconds); ... |
String | getFormatTime(Date date) get Format Time return getFormatDateTime(date, "yyyy-MM-dd HH:mm:ss"); |
String | getFormatTime(String format) get Format Time sFormat = new SimpleDateFormat(format, Locale.CHINA); return sFormat.format(new Date()); |