use of org.hsqldb_voltpatches.types.TimestampData in project voltdb by VoltDB.
the class Session method getCurrentTimestamp.
/**
* Returns the current timestamp, unchanged for the duration of the current
* execution unit (statement)
*/
synchronized TimestampData getCurrentTimestamp(boolean withZone) {
resetCurrentTimestamp();
if (withZone) {
if (currentTimestamp == null) {
int nanos = (int) (currentMillis % 1000) * 1000000;
currentTimestamp = new TimestampData((currentMillis / 1000), nanos, timeZoneSeconds);
}
return currentTimestamp;
} else {
if (localTimestamp == null) {
int nanos = (int) (currentMillis % 1000) * 1000000;
localTimestamp = new TimestampData(currentMillis / 1000 + timeZoneSeconds, nanos, 0);
}
return localTimestamp;
}
}
Aggregations