List of utility methods to do Timestamp Format
String | formatTimestamp(long timestamp) format Timestamp if (timestamp <= 0) { return "null"; } else { return timestampDateFormat.get().format(new Date(timestamp)); |
String | formatTimestamp(long timestamp) format Timestamp Date date = new Date(timestamp); final DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); df.setTimeZone(tzUTC); return timestamp + " (" + df.format(date) + ")"; |
String | formatTimestamp(long ts) format Timestamp return new SimpleDateFormat("HH:mm:ss.SSS", Locale.ROOT).format(new Date(ts)); |
String | formatTimestamp(String dateStr, String granularity) format Timestamp SimpleDateFormat yearFormat = new SimpleDateFormat("yyyy"); SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); String timestamp = null; try { if (dateStr == null) { } else if (dateStr.length() == 4) { Date yearDate = yearFormat.parse(dateStr); ... |
String | formatTimestamp(Timestamp dataHora) format Timestamp if (dataHora == null) return ""; SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); return format.format(dataHora); |
String | formatTimeStamp(Timestamp t) Format the TimeStamp like 2009-06-01T06:12:45Z SimpleDateFormat formatter = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.MONTH_FIELD, DateFormat.LONG, Locale.US); formatter.setTimeZone(TimeZone.getTimeZone("GMT")); formatter.applyPattern("yyyy-MM-dd"); String timestamp = formatter.format(t); formatter.applyPattern("hh:mm:ss"); return timestamp + "T" + formatter.format(t) + "Z"; |
String | formatTimestamp(Timestamp t, int type) ACME timestamp formatter DateFormat format = null; switch (type) { case FORMAT_DD_MM_YYYY_HH_MM_SS: format = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); break; case FORMAT_YYYY_MM_DD_HH_MM_SS: format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); break; ... |
String | formatTimestamp(Timestamp timestamp) format Timestamp if (timestamp != null) { DateFormat formatter = new SimpleDateFormat(DATE_TIME_PATTERN); return formatter.format(timestamp.getTime()); return null; |
String | formatTimestamp(Timestamp timestamp, int iType) format Timestamp String timeStr = ""; if (timestamp != null) { timeStr = getStrDate(new Long(timestamp.getTime()), iType); return timeStr; |
String | formatTimestamp(Timestamp timestamp, String pattern) Formats a timestamp into a string. return new SimpleDateFormat(pattern).format(timestamp); |