Java Utililty Methods Timestamp Create

List of utility methods to do Timestamp Create

Description

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

Method

StringgetTimeStamp()
get Time Stamp
Calendar today = new GregorianCalendar();
SimpleDateFormat df = new SimpleDateFormat();
df.applyPattern("yyyyMMDD_HHMMss");
return df.format(today.getTime());
StringgetTimestamp()
get Timestamp
DateFormat df = dfs.get();
if (df == null) {
    TimeZone tz = TimeZone.getTimeZone("UTC");
    df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
    df.setTimeZone(tz);
    dfs.set(df);
return df.format(new Date());
...
StringgetTimeStamp()
Get the current time string as "HHmmss".
SimpleDateFormat pattern = new SimpleDateFormat("HHmmss");
Calendar now = Calendar.getInstance();
pattern.setCalendar(now);
return pattern.format(now.getTime());
StringgetTimestamp()
Returns a timestamp that is set to the time when DataLoader was started.
if (timestamp == null) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
    timestamp = dateFormat.format(new Date());
return timestamp;
StringgetTimeStamp()
get Time Stamp
return String.valueOf(new Date().getTime()).substring(0, 10);
StringgetTimestamp()
Get the current human readable timestamp.
DateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd hh:mm:ss:S");
return (dateFormat.format(new Date()));
StringgetTimeStamp()
get Time Stamp
String timeStamp = new SimpleDateFormat(TIMESTAMP_FORMAT).format(new Date());
return timeStamp;
StringgetTimestamp()
get Timestamp
calendar.add(Calendar.SECOND, random.nextInt(3));
String result = simpleDate.format(calendar.getTime());
return "[" + result + "]";
StringgetTimeStamp()
Get the current date and time (useful for logs, is thread safe).
return new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy").format(new Date(System.currentTimeMillis()));
StringgetTimeStamp()
This method is for obtaining the time stamp of the system.
DateFormat dateFormat = new SimpleDateFormat("yy/MM/dd HH:mm:ss");
Calendar cal = Calendar.getInstance();
return dateFormat.format(cal.getTime()) + "-" + cal.getTimeInMillis();