List of utility methods to do Timestamp Format
String | formatString(Timestamp da) format String String datastring = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); datastring = sdf.format(da); return datastring; |
Timestamp | formatStringToTimeStamp(String s) Format the TimeStamp like 2009-06-01 06:12:45 return Timestamp.valueOf(s.replace("T", " ").replace("Z", "")); |
String | formattedDateTime(long timestamp) formatted Date Time SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); return dateFormat.format(new Date(timestamp)); |
String | formatTime(Date aTs_Datetime) format Time return format(aTs_Datetime, TIME_PATTERN_DEFAULT);
|
String | formatTime(Date date) format Time if (date == null) { return null; } else { return monthDayYearformatter.format(date); |
String | formatTime(Timestamp time, boolean onlyTime) This method converts a JDBC format date into a String
if (time == null) return null; return (onlyTime) ? userTimeOnlyFmt.format(time) : userTimeFmt.format(time); |
String | formatTime(Timestamp ts, Locale locale) Aus einem Timestampt die Zeit Locale abhaengig herausholen. return DateFormat.getTimeInstance(DateFormat.SHORT, locale).format(ts);
|
String | formatTimeFromTimestamp(long ts, String fmt) Format timestamp ts to string of format fmt, in UTC, for example, yyyy-MM-dd HH:mm:ss java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(fmt); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); try { return sdf.format(new Date(ts)); } catch (Exception ex) { return ""; |
String | formatTimestamp(Date date) Formats a date object based on the format setting in compass.timestampFormat if (date == null) { return ""; return getTimestampFormat().format(date); |
String | formatTimestamp(Date timestamp) Formats the Date into a timestamp string in YYYY-MM-dd HH:mm:ss GMT. if (timestamp == null) { return "[No timestamp]"; SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(timestamp); |