Java Utililty Methods Timestamp Now

List of utility methods to do Timestamp Now

Description

The list of methods to do Timestamp Now are organized into topic(s).

Method

TimestampgetCurrentTimeStamp()
get Current Time Stamp
try {
    Calendar cal = new GregorianCalendar();
    Timestamp result = new Timestamp(cal.getTime().getTime());
    return result;
} catch (Exception e) {
    throw new Exception("[DateUtil][getCurrentTimeStamp]" + e.getMessage(), e);
java.sql.TimestampgetCurrentTimeStamp()
get Current Time Stamp
java.util.Date today = new java.util.Date();
return new java.sql.Timestamp(today.getTime());
StringgetCurrentTimestamp()
get Current Timestamp
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Timestamp(System.currentTimeMillis()));
java.sql.TimestampgetCurrentTimestamp()
Returns a Timestamp object, using milliseconds since January 1, 1970, 00:00:00 GMT.
return new java.sql.Timestamp(Calendar.getInstance().getTime().getTime());
TimestampgetCurrentTimestamp()
get Current Timestamp
return new Timestamp(getDate().getTime());
TimestampgetCurrentTimeStamp()
get Current Time Stamp
return new Timestamp(new GregorianCalendar().getTime().getTime());
TimestampgetCurrentTimestamp()
get Current Timestamp
return new Timestamp((new Date()).getTime());
TimestampgetCurrentTimeStamp()
get Current Time Stamp
return getTimeStamp(new java.util.Date());
java.sql.TimestampgetCurrentTimestamp()
getCurrentTimestamp Returns current time in Timestamp object.
java.util.Calendar tmp = java.util.Calendar.getInstance();
tmp.clear(java.util.Calendar.MILLISECOND);
return (new java.sql.Timestamp(tmp.getTime().getTime()));
TimestampgetCurrentTimestamp()
get Current Timestamp
return (new Timestamp((getCurrentDate()).getTime()));