List of utility methods to do Timestamp Format
int | compareTimstampStr(String timestamp1, String timestamp2, String format) compare Timstamp Str int result = 10; SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); long temp = 10L; try { Date date1 = simpleDateFormat.parse(timestamp1); Date date2 = simpleDateFormat.parse(timestamp2); temp = date1.getTime() - date2.getTime(); } catch (ParseException e) { ... |
Date | decodeFileTimestamp(File file, Pattern filenamePattern, DateFormat dateFormat) Decode a file's timestamp given a pattern to extract the timestamp from its name (in group 1) and a dateFormat to parse the date. Date result = null; final String name = file.getName(); final Matcher m = filenamePattern.matcher(name); if (m.matches()) { try { result = dateFormat.parse(m.group(1)); } catch (ParseException e) { return result; |
String | format(BigDecimal data) format if (data == null) { return null; DecimalFormat format = new DecimalFormat(PATTERN); return format.format(data); |
String | format(Date aTs_Datetime) format return format(aTs_Datetime, DATE_PATTERN_DEFAULT);
|
String | format(Date date) format return format(date, PATTERN_CLASSICAL);
|
String | format(Date date, String format) format SimpleDateFormat sf = new SimpleDateFormat(format); sf.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai")); return sf.format(date); |
String | format(Date time, String pattern) format SimpleDateFormat sdf = new SimpleDateFormat(pattern); return sdf.format(time); |
String | format(Date timestamp) Formats the given timestamp according OGC standard SimpleDateFormat formatter = new SimpleDateFormat(zuluFormat); formatter.setTimeZone(TimeZone.getTimeZone("GMT")); return formatter.format(timestamp); |
String | format(Date timestamp, String format) format SimpleDateFormat formatter = new SimpleDateFormat(format); return formatter.format(timestamp); |
String | Format(DateFormat format, Timestamp time) Format synchronized (format) { String t = ""; try { t = format.format(time); } catch (Exception e) { return t; return t; ... |