Java Utililty Methods Timestamp

List of utility methods to do Timestamp

Description

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

Method

TimestampnormalizeDateTimeAsTimestamp(Date changedDate, Locale locale)
normalize Date Time As Timestamp
return new Timestamp(normalizeDateTime(changedDate, locale).getTime());
TimestampnowAsTimestamp()
Get now time as timestamp
return new Timestamp(nowAsLong());
TimestampnowUtcTimestamp()
now Utc Timestamp
return Timestamp.valueOf(nowUtc());
TimestampobjToTimeStamp(Object obj)
obj To Time Stamp
Timestamp tt = null;
if (obj != null) {
    tt = (Timestamp) obj;
return tt;
StringprintFull(Timestamp ts)
print Full
return DATE_TIME_FORMATTER_FULL.print(ts.getTime());
StringquoteMySQLDataField(Timestamp fieldData)
quote My SQL Data Field
String strResult = "";
if (fieldData != null)
    strResult = "\"" + fieldData + "\"";
else
    strResult = "null";
return strResult;
TimestamprandomTimestamp()
random Timestamp
return new Timestamp(new Date().getTime());
TimestampreadTimestamp(ByteBuffer logBuf)
Read a timestamp from the log.
long millis = readLong(logBuf);
return new Timestamp(millis);
TimestampreadTimestamp(DataInput in)
Reads a Timestamp value.
if (readNullFlag(in))
    return null;
return new Timestamp(in.readLong());
TimestampreadTimestamp(ObjectInput in, long nullFlag)
read Timestamp
Timestamp stamp = null;
long value = in.readLong();
if (value != nullFlag) {
    stamp = new Timestamp(value);
return stamp;