List of utility methods to do Timestamp
Timestamp | timestamp(Long param) Converts Long value to appropriate SQL timestamp parameter. return param != null ? new Timestamp(param) : null; |
long | timestampInMs() timestamp In Ms return getTimestamp().getTime();
|
Timestamp | timestampIntToTimestamp(long timestampInt) Converts timestamp to Timestamp -object
return timestampIntToTimestamp(String.valueOf(timestampInt));
|
boolean | timestampIsEquals(Timestamp timestamp1, Timestamp timestamp2) timestamp Is Equals return (timestamp1.compareTo(timestamp2) == 0);
|
String | TimeStampMonthDayYear(Timestamp timestamp) Time Stamp Month Day Year if (timestamp == null) { return null; } else { return monthDayYearformatter.format((java.util.Date) timestamp); |
Timestamp | TimestampNow() return the current system time as an SQL Timestamp. java.util.Date now = new java.util.Date(); return new Timestamp(now.getTime()); |
java.sql.Timestamp | timestampNow() convienence routine to return current UTC time in Sql timestamp Calendar now = GregorianCalendar.getInstance(utcTZ); java.sql.Timestamp sqlNow = new java.sql.Timestamp(now.getTimeInMillis()); return sqlNow; |
Timestamp | timestampOf(final ZonedDateTime time) Gets Timestamp for ZonedDateTime. return timestampOf(time.toInstant());
|
long | timestampPlusDay(java.sql.Timestamp ts, int iDayPlus) timestamp Plus Day if (ts == null) { return -1; java.util.Calendar calendar = java.util.Calendar.getInstance(); calendar.setTimeInMillis(ts.getTime()); int iDay = calendar.get(calendar.DAY_OF_MONTH); calendar.set(calendar.DAY_OF_MONTH, iDay + iDayPlus); java.sql.Timestamp tsNew = new java.sql.Timestamp((calendar.getTime()).getTime()); ... |
String | timestampPlusDay2DDMMYYYY(java.sql.Timestamp ts, int iDayPlus) return string dd/mm/yyyy from a Timestamp + a addtional day if (ts == null) { return ""; java.util.Calendar calendar = java.util.Calendar.getInstance(); calendar.setTime(new java.util.Date(ts.getTime())); int iDay = calendar.get(calendar.DAY_OF_MONTH); calendar.set(calendar.DAY_OF_MONTH, iDay + iDayPlus); java.sql.Timestamp tsNew = new java.sql.Timestamp((calendar.getTime()).getTime()); ... |