List of utility methods to do Timestamp Field
String | getFormattedDateTimeColumn(final Timestamp ts, final SimpleDateFormat formatDate) get Formatted Date Time Column String dt = ""; if (ts != null) { dt = formatDate.format(new Date(ts.getTime())); if (dt == null) { dt = ""; return dt; ... |
String | getFormattedTimeStamp(long millisSince1970) get Formatted Time Stamp Timestamp stamp = new Timestamp(millisSince1970); SimpleDateFormat formatDate = new SimpleDateFormat(MARTUS_SIGNATURE_FILE_DATE_FORMAT); String dateStamp = formatDate.format(stamp); return dateStamp; |
Date | getFromTimestamp(Timestamp timestamp) Get a date from a timestamp if (timestamp == null) { return null; return new Date(timestamp.getTime()); |
String | getHms(Timestamp timestamp) get Hms SimpleDateFormat bartDateFormat = new SimpleDateFormat("HH:mm:ss"); String hms = bartDateFormat.format(timestamp); return hms; |
String | getHoraHHMM(Timestamp dataHoraRef) get Hora HHMM StringBuilder sb = new StringBuilder(); GregorianCalendar d = new GregorianCalendar(); d.setTime(dataHoraRef); String aux = "" + d.get(GregorianCalendar.HOUR_OF_DAY); if (aux.length() < 2) aux = "0" + aux; sb.append(aux); aux = "" + d.get(GregorianCalendar.MINUTE); ... |
Integer | getInterval(ArrayList get Interval int min = Integer.MAX_VALUE; int max = Integer.MIN_VALUE; System.out.printf("Printing %s\n" + times.get(0).toString()); System.out.printf("Printing %s\n" + times.get(times.size() - 1).toString()); Integer length = times.size(); return length; |
int | getIntervalInDays(Timestamp from, Timestamp thru) get Interval In Days return thru != null ? (int) (thru.getTime() - from.getTime()) / (24 * 60 * 60 * 1000) : 0; |
String | getISOTimeStampStringFormat(Timestamp ts) get ISO Time Stamp String Format String result = ""; try { String temp = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(ts); result = temp.substring(0, 4); result = result + "-"; result = result + temp.substring(5, 7); result = result + "-"; result = result + temp.substring(8, 10); ... |
Timestamp | getKDCTStoTimestamp(short[] in) Helper für KDC100 Konvertiert KDC100 Timestamp auf java.sql.Timestamp Calendar c = getKDCTStoCal(in); Timestamp ts = new java.sql.Timestamp(c.getTimeInMillis()); return ts; |
LocalDateTime | getLocalDateTime(final long timestamp) Gets the LocalDateTime for a timestamp in UTC
return getLocalDateTime(getInstant(timestamp));
|