public class PGTimestamp extends Timestamp
| Constructor and Description |
|---|
PGTimestamp(long time)
Constructs a
PGTimestamp without a time zone. |
PGTimestamp(long time,
Calendar calendar)
Constructs a
PGTimestamp with the given time zone. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
equals(Object obj)
Tests to see if this
Timestamp object is
equal to the given object. |
Calendar |
getCalendar()
Returns the calendar object for this timestamp.
|
int |
hashCode()
The
hashCode method uses the underlying java.util.Date
implementation and therefore does not include nanos in its computation. |
void |
setCalendar(Calendar calendar)
Sets the calendar object for this timestamp.
|
after, before, compareTo, compareTo, equals, getNanos, getTime, setNanos, setTime, toString, valueOfafter, before, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTCpublic PGTimestamp(long time)
PGTimestamp without a time zone. The integral
seconds are stored in the underlying date value; the fractional seconds
are stored in the nanos field of the Timestamp
object.time - milliseconds since January 1, 1970, 00:00:00 GMT. A negative
number is the number of milliseconds before January 1, 1970,
00:00:00 GMT.Timestamp.Timestamp(long)public PGTimestamp(long time,
Calendar calendar)
PGTimestamp with the given time zone. The
integral seconds are stored in the underlying date value; the fractional
seconds are stored in the nanos field of the
Timestamp object.
The calendar object is optional. If absent, the driver will treat the
timestamp as timestamp without time zone. When present, the
driver will treat the timestamp as a timestamp with time zone
using the TimeZone in the calendar object. Furthermore, this
calendar will be used instead of the calendar object passed to
PreparedStatement.setTimestamp(int, Timestamp, Calendar).
time - milliseconds since January 1, 1970, 00:00:00 GMT. A negative
number is the number of milliseconds before January 1, 1970,
00:00:00 GMT.calendar - the calendar object containing the time zone or
null.Timestamp.Timestamp(long)public void setCalendar(Calendar calendar)
calendar - the calendar object or null.public Calendar getCalendar()
null.public int hashCode()
java.sql.TimestamphashCode method uses the underlying java.util.Date
implementation and therefore does not include nanos in its computation.public boolean equals(Object obj)
java.sql.TimestampTimestamp object is
equal to the given object.
This version of the method equals has been added
to fix the incorrect
signature of Timestamp.equals(Timestamp) and to preserve backward
compatibility with existing class files.
Note: This method is not symmetric with respect to the
equals(Object) method in the base class.Copyright © 2015 PostgreSQL Global Development Group. All rights reserved.