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()
Gets the current timestamp using the format "dd.MM.yyyy HH:mm:ss,SSS ".
Format format = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss,SSS ");
double current = System.currentTimeMillis();
String timestamp = format.format(current);
return timestamp;
StringgetTimestamp()
get Timestamp
Date date = new Date();
DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
return df.format(date);
StringgetTimestamp()
get Timestamp
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
return "[".concat(sdf.format(new Date())).concat("]");
StringgetTimestamp()
get Timestamp
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
Calendar c = Calendar.getInstance();
TimeZone z = c.getTimeZone();
int offset = z.getRawOffset();
if (z.inDaylightTime(date)) {
    offset = offset + z.getDSTSavings();
...
TimestampgetTimestamp(Calendar time)
Converts Calendar to java.sql.Timestamp
return new Timestamp(time.getTimeInMillis());
StringgetTimeStamp(Date date)
Returns a time stamp of the format "yy.MM.dd - HH:mm" for the given date.
SimpleDateFormat formatter = new SimpleDateFormat("yy.MM.dd - HH:mm");
return formatter.format(date);
StringgetTimeStamp(Date date)
get Time Stamp
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
String cs = formatter.format(date);
return cs;
StringgetTimeStamp(Date date)
get Time Stamp
SimpleDateFormat format = new SimpleDateFormat(timePattern2);
return format.format(date);
StringgetTimeStamp(Date date)
get Time Stamp
TimeStampFormat.format(date);
return null;
StringgetTimestamp(Date date)
get Timestamp
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return dateFormat.format(date);