Class: SqlTimestamp

eclairjs/sql.SqlTimestamp

A thin wrapper around Date that allows the JDBC API to identify this as an SQL TIMESTAMP value. It adds the ability to hold the SQL TIMESTAMP fractional seconds value, by allowing the specification of fractional seconds to a precision of nanoseconds. A Timestamp also provides formatting and parsing operations to support the JDBC escape syntax for timestamp values.

Constructor

new SqlTimestamp(number)

Parameters:
Name Type Description
number number | string | Date of millisecond, string date representation, or Date object
Source:

Methods

after(when) → {boolean}

Indicates whether this Timestamp object is later than the given Timestamp object.
Parameters:
Name Type Description
when module:eclairjs/sql.SqlTimestamp
Source:
Returns:
Type
boolean

before(when) → {boolean}

Indicates whether this Timestamp object is earlier than the given Timestamp object.
Parameters:
Name Type Description
when module:eclairjs/sql.SqlTimestamp
Source:
Returns:
Type
boolean

compareTo(when) → {integer}

Compares this Timestamp object to the given Date or Timestamp object.
Parameters:
Name Type Description
when SqlDate | SqlTimestamp
Source:
Returns:
Type
integer

equals(when) → {boolean}

Tests to see if this Timestamp object is equal to the given Timestamp object.
Parameters:
Name Type Description
when module:eclairjs/sql.SqlTimestamp
Source:
Returns:
Type
boolean

getNanos() → {integer}

Gets this Timestamp object's nanos value.
Source:
Returns:
Type
integer

getTime() → {integer}

Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Timestamp object
Source:
Returns:
Type
integer

hashCode() → {integer}

Returns a hash code value for this object.
Source:
Returns:
Type
integer

setNanos(n)

Sets this Timestamp object's nanos field to the given value.
Parameters:
Name Type Description
n integer
Source:

setTime(n)

Sets this Timestamp object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
Parameters:
Name Type Description
n integer
Source:

toJSON() → {string}

Formats a timestamp in JDBC timestamp escape format.
Source:
Returns:
Type
string

toString() → {string}

Formats a timestamp in JDBC timestamp escape format.
Source:
Returns:
Type
string