List of utility methods to do Timestamp Format
String | getFormattedTimestamp(@Nonnull Date date) get Formatted Timestamp synchronized (FORMAT_TIMESTAMP) { return FORMAT_TIMESTAMP.format(date); |
String | getFormattedTimestamp(File file) get Formatted Timestamp return file != null && file.exists() ? getLocaleFormattedDateTime(file.lastModified()) : null;
|
String | getFormattedTimeStamp(long timestamp, String formatString) get Formatted Time Stamp Date date = new Date(timestamp); DateFormat formatter = new SimpleDateFormat(formatString, Locale.US); return (formatter.format(date)); |
DateFormat | getFullTimestampFormatter(Locale locale) get Full Timestamp Formatter DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, locale); String localeString = locale.toString(); if (localeString.equals("zh_SG")) { return new SimpleDateFormat("dd/MM/yyyy a hh:mm"); } else if (localeString.equals("ko")) { return changeDateFormatPattern(dateFormat, "y+\\. *M+\\. *d+", "yyyy-MM-dd"); return changeDateFormatPattern(dateFormat, "y+", "yyyy"); ... |
String | getTimestamp(boolean useTwentyFourFormat) Generates message timestamp. return "<small>" + getCurrentHour(useTwentyFourFormat) + ":" + getCurrentMinutes() + "</small> "; |
String | getTimeStamp(String format) Gets a timestamp using the given format. Date date = new Date(); SimpleDateFormat sdf; try { sdf = new SimpleDateFormat(format); } catch (NullPointerException | IllegalArgumentException e) { sdf = new SimpleDateFormat(TIMESTAMP_FORMAT); return sdf.format(date); ... |
String | getTimestamp(String format) Get timestamp. return _datetime(format);
|
SimpleDateFormat | getTimestampFormat() get Timestamp Format ThreadLocal<SimpleDateFormat> tl = timestampFormatPool.get(timestampPattern); if (null == tl) { synchronized (timestampFormatLock) { tl = timestampFormatPool.get(timestampPattern); if (null == tl) { tl = new ThreadLocal<SimpleDateFormat>() { @Override protected synchronized SimpleDateFormat initialValue() { ... |
String | getTimeStampFormat(Date date) get Time Stamp Format return mDateFormat.format(date) + " " + mElapsedTimeFormat.format(date); |
String | getTimeStampFormat(Date date) get Time Stamp Format if (date == null) return null; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSSSS"); return simpleDateFormat.format(date); |