List of utility methods to do Timestamp Now
Timestamp | getCurrentTimeStamp(int offsetDays) get Current Time Stamp Timestamp ts = new Timestamp(System.currentTimeMillis()); Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(ts); calendar.add(Calendar.DAY_OF_YEAR, offsetDays); ts.setTime(calendar.getTime().getTime()); return new Timestamp(calendar.getTime().getTime()); |
String | getCurrentTimeStamp(String format) get Current Time Stamp SimpleDateFormat f = new SimpleDateFormat(format); String timeStamp = f.format(new Date()); return timeStamp; |
String | getCurrentTimestampAsString() get Current Timestamp As String return getCurrentTimestamp().toString();
|
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) { ... |
java.sql.Timestamp | getTimestamp() get Timestamp return new java.sql.Timestamp(new java.util.Date().getTime()); |
Timestamp | getTimestamp() Return the actual time return new Timestamp(Calendar.getInstance().getTimeInMillis()); |
Timestamp | getTimestamp() get Timestamp return new Timestamp(getTime()); |
Timestamp | getTimestamp() Creates a java.sql.Timestamp from now. return getTimestamp(new Date()); |
Timestamp | getTimestamp() get Timestamp return toTimestamp(getSqlDate());
|
String | getTimeStamp() get Time Stamp Timestamp timestamp = new Timestamp(System.currentTimeMillis()); Date date = new Date(timestamp.getTime()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy' 'HH:MM:ss:S"); return simpleDateFormat.format(timestamp); |