List of utility methods to do Timestamp Now
String | generateTimestamp() Creates a properly formatted time stamp return new SimpleDateFormat("MM/dd/yy HH:mm:ss.SSS").format(Calendar.getInstance().getTime()); |
String | generateTimestamp() Generate the current datetimestamp in the string formaat (YYYYMMDDHHSS) required in a request to Realex. return new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); |
Timestamp | getAfterSecond(Timestamp currentDate) get After Second Calendar calender = Calendar.getInstance(); calender.setTime(currentDate); calender.add(Calendar.SECOND, 1); return new Timestamp(calender.getTimeInMillis()); |
String | getCurrentAgeForDate(Timestamp birthDate, Timestamp endDate) get Current Age For Date if (birthDate != null) { long age = endDate.getTime() - birthDate.getTime(); Date ageDate = new Date(age); Calendar calendar = new GregorianCalendar(); calendar.setTime(ageDate); return String.valueOf(calendar.get(Calendar.YEAR) - EPIC); return null; ... |
Timestamp | getCurrentDateAsTimestamp() get Current Date As Timestamp return floorAsDate(getCurrentTimestamp());
|
Timestamp | getCurrentDateTimestamp() get Current Date Timestamp DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Timestamp createDttm = Timestamp.valueOf(df.format(new java.util.Date())); return createDttm; |
Timestamp | getCurrentDBTimestamp() Method to return current db time in Timestamp formate SimpleDateFormat simple = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); String strDate = simple.format(new java.util.Date()); Timestamp timestamp = Timestamp.valueOf(strDate); return timestamp; |
java.sql.Timestamp | getCurrentSQLTimestamp() Gets the current SQL timestamp. Calendar c = Calendar.getInstance(); java.sql.Timestamp t = new java.sql.Timestamp(c.getTimeInMillis()); return t; |
java.sql.Timestamp | getCurrentSQLTimestamp() get current SQL Timestamp returns a date in following format: 2003-04-01 08:21:57.556 java.sql.Timestamp sqlTime = new java.sql.Timestamp(System.currentTimeMillis()); return sqlTime; |
Timestamp | getCurrentTimeStamp() Produce an instance of Timestamp which can produce a string representation understood by Derby, and which reflects the current Date and Time. final Calendar cal = new GregorianCalendar(); final Date currDate = cal.getTime(); return new Timestamp(currDate.getTime()); |