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

StringcurrentTimeStamp()
current Time Stamp
return DateFormat.getDateTimeInstance().format(new Date());
TimestampcurrentTimeStamp()
Generates the current timestamp.
final GregorianCalendar cal = new GregorianCalendar();
final long millis = cal.getTimeInMillis();
return new Timestamp(millis);
StringcurrentTimeStamp()
Return current date and time in terse format
java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("MM/dd/yy HH:mm:ss");
return df.format(new java.util.Date(System.currentTimeMillis())) + " ";
TimestampcurrentTimestamp()
current Timestamp
return new Timestamp(currentTimeMillis());
StringcurrentTimestamp()
current Timestamp
Date now = new Date();
return INTERNATE_DATE_FORMAT.format(now);
TimestampcurrentTimestamp()
current Timestamp
return new Timestamp(new Date().getTime());
StringcurrentTimestamp2String(String pattern)
current Timestamp String
return timestamp2String(currentTimestamp(), pattern);
TimestampcurrentTimestampPlus(final long seconds)
current Timestamp Plus
return new Timestamp(System.currentTimeMillis() + seconds * 1000);
StringgenerateTimestamp()
generate Timestamp
SimpleDateFormat dateFormatter = new SimpleDateFormat(AUTH_DATE_FORMAT);
dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
return dateFormatter.format(new Date());
StringgenerateTimeStamp()
generate Time Stamp
SimpleDateFormat dateFormat = new SimpleDateFormat("yy-MM-dd-HH-mm-ss");
Date date = new Date();
return dateFormat.format(date);