List of utility methods to do Timestamp Field
java.sql.Timestamp | getNextDayStart(java.sql.Timestamp stamp) get Next Day Start return getDayStart(stamp, 1);
|
Timestamp | getNextTimestamp(Timestamp previous, long nrDays) get Next Timestamp return new Timestamp(previous.getTime() + (nrDays * 24 * 60 * 60 * 1000)); |
Timestamp | getNotNullTimestampValue(String timestamp, String format) get Not Null Timestamp Value Timestamp value; try { if (timestamp == null || timestamp.equals("")) { value = new Timestamp(System.currentTimeMillis()); } else { SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format); value = new Timestamp(simpleDateFormat.parse(timestamp).getTime()); } catch (Exception e) { e.printStackTrace(); value = new Timestamp(System.currentTimeMillis()); return value; |
java.sql.Timestamp | getNowTimestamp() get Now Timestamp Calendar cal1 = Calendar.getInstance(); return new java.sql.Timestamp(cal1.getTimeInMillis()); |
long | getNowTimeStamp() get Now Time Stamp long returnTimeStamp = 0; Date aDate = null; try { aDate = convertStringToDate("yyyy-MM-dd HH:mm:ss", getNowDateTime()); } catch (ParseException pe) { aDate = null; if (aDate == null) { ... |
Timestamp | getNowTimeStamp() get Now Time Stamp return new Timestamp(getNow().getTime()); |
Timestamp | getOffsetDaysTime(Timestamp sysDate, int offsetDays) get Offset Days Time Calendar calendar = Calendar.getInstance(); calendar.setTime(sysDate); calendar.add(Calendar.DAY_OF_MONTH, offsetDays); return new Timestamp(calendar.getTimeInMillis()); |
String | getPerformanceTime(Timestamp startTime) Gets the performance time. return getTimeDifference(startTime, new Timestamp(System.currentTimeMillis())); |
Timestamp | getPeriodExpiration(Timestamp tsStartDate, int iPeriodType, int iPeriodDuration) Get expiration timestamp from start date, period type and duration. Timestamp tsReturn = null; Calendar calHelp; if (tsStartDate != null && iPeriodDuration > 0 && iPeriodType > TIMING_NEVER && iPeriodType < TIMING_NONE) { calHelp = Calendar.getInstance(); calHelp.setTime(tsStartDate); switch (iPeriodType) { case (TIMING_MINUTES): { calHelp.add(Calendar.MINUTE, iPeriodDuration); ... |
Timestamp | getPresentTimeStamp() get Present Time Stamp Timestamp ts = null; java.util.Date d = new java.util.Date(); ts = new Timestamp(d.getTime()); return ts; |