ValueTimestamp

Implementation of the TIMESTAMP data type.

Methods
static ValueTimestamp fromDateValueAndNanos(long dateValue, long timeNanos)
Get or create a date value for the given date.
static ValueTimestamp fromDateValueAndNanos(long dateValue, long timeNanos)
Get or create a date value for the given date.
Parameters:
dateValue - the date value, a bit field with bits for the year, month, and day
timeNanos - the nanoseconds since midnight
Returns:
the value
static ValueTimestamp fromMillis(long ms)
Get or create a timestamp value for the given date/time in millis.
static ValueTimestamp fromMillis(long ms)
Get or create a timestamp value for the given date/time in millis.
Parameters:
ms - the milliseconds
Returns:
the value
static ValueTimestamp fromMillisNanos(long ms, int nanos)
Get or create a timestamp value for the given date/time in millis.
static ValueTimestamp fromMillisNanos(long ms, int nanos)
Get or create a timestamp value for the given date/time in millis.
Parameters:
ms - the milliseconds
nanos - the nanoseconds
Returns:
the value
static ValueTimestamp get(Timestamp timestamp)
Get or create a timestamp value for the given timestamp.
static ValueTimestamp get(Timestamp timestamp)
Get or create a timestamp value for the given timestamp.
Parameters:
timestamp - the timestamp
Returns:
the value
static int getDisplaySize(int scale)
Get display size for the specified scale.
static int getDisplaySize(int scale)
Get display size for the specified scale.
Parameters:
scale - scale
Returns:
display size
static ValueTimestamp parse(String s)
Parse a string to a ValueTimestamp.
static ValueTimestamp parse(String s)
Parse a string to a ValueTimestamp. This method supports the format +/-year-month-day hour[:.]minute[:.]seconds.fractional and an optional timezone part.
Parameters:
s - the string to parse
Returns:
the date
static ValueTimestamp parse(String s, Mode mode)
Parse a string to a ValueTimestamp, using the given
static ValueTimestamp parse(String s, Mode mode)
Parse a string to a ValueTimestamp, using the given {@link Mode}. This method supports the format +/-year-month-day[ -]hour[:.]minute[:.]seconds.fractional and an optional timezone part.
Parameters:
s - the string to parse
mode - the database {@link Mode}
Returns:
the date
Value add(Value v)
Value add(Value v)
boolean checkPrecision(long precision)
boolean checkPrecision(long precision)
int compareSecure(Value o, CompareMode mode)
int compareSecure(Value o, CompareMode mode)
Value convertScale(boolean onlyToSmallerScale, int targetScale)
Value convertScale(boolean onlyToSmallerScale, int targetScale)
boolean equals(Object other)
boolean equals(Object other)
long getDateValue()
A bit field with bits for the year, month, and day (see DateTimeUtils for encoding).
long getDateValue()
A bit field with bits for the year, month, and day (see DateTimeUtils for encoding).
Returns:
the data value
int getDisplaySize()
int getDisplaySize()
Object getObject()
Object getObject()
long getPrecision()
long getPrecision()
String getSQL()
String getSQL()
int getScale()
int getScale()
String getString()
String getString()
long getTimeNanos()
The nanoseconds since midnight.
long getTimeNanos()
The nanoseconds since midnight.
Returns:
the nanoseconds
Timestamp getTimestamp()
Timestamp getTimestamp()
int getType()
int getType()
int hashCode()
int hashCode()
void set(PreparedStatement prep, int parameterIndex)
void set(PreparedStatement prep, int parameterIndex) throws SQLException
Value subtract(Value v)
Value subtract(Value v)

Fields
static int DEFAULT_PRECISION = 26
static int DEFAULT_SCALE = 6
static int MAXIMUM_PRECISION = 29
static int MAXIMUM_SCALE = 9

DEFAULT_PRECISION = 26

The default precision and display size of the textual representation of a timestamp. Example: 2001-01-01 23:59:59.123456

MAXIMUM_PRECISION = 29

The maximum precision and display size of the textual representation of a timestamp. Example: 2001-01-01 23:59:59.123456789

DEFAULT_SCALE = 6

The default scale for timestamps.

MAXIMUM_SCALE = 9

The maximum scale for timestamps.