public class PGTime extends Time
Constructor and Description |
---|
PGTime(long time)
Constructs a
PGTime without a time zone. |
PGTime(long time,
Calendar calendar)
Constructs a
PGTime with the given calendar object. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Return a copy of this object.
|
boolean |
equals(Object obj)
Compares two dates for equality.
|
Calendar |
getCalendar()
Returns the calendar object for this time.
|
int |
hashCode()
Returns a hash code value for this object.
|
void |
setCalendar(Calendar calendar)
Sets the calendar object for this time.
|
getDate, getDay, getMonth, getYear, setDate, setMonth, setTime, setYear, toInstant, toLocalTime, toString, valueOf, valueOf
after, before, compareTo, from, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC
public PGTime(long time)
PGTime
without a time zone.time
- milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds
before January 1, 1970, 00:00:00 GMT.Time.Time(long)
public PGTime(long time, Calendar calendar)
PGTime
with the given calendar object. The calendar object is
optional. If absent, the driver will treat the time as time without time zone
.
When present, the driver will treat the time as a time with time zone
using the
TimeZone
in the calendar object. Furthermore, this calendar will be used instead
of the calendar object passed to PreparedStatement.setTime(int, Time, Calendar)
.time
- milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds
before January 1, 1970, 00:00:00 GMT.calendar
- the calendar object containing the time zone or null
.Time.Time(long)
public void setCalendar(Calendar calendar)
calendar
- the calendar object or null
.public Calendar getCalendar()
null
.public int hashCode()
java.util.Date
Date.getTime()
method. That is, the hash code is the value of the expression:
(int)(this.getTime()^(this.getTime() >>> 32))
hashCode
in class Date
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object obj)
java.util.Date
true
if and only if the argument is
not null
and is a Date
object that
represents the same point in time, to the millisecond, as this object.
Thus, two Date
objects are equal if and only if the
getTime
method returns the same long
value for both.
equals
in class Date
obj
- the object to compare with.true
if the objects are the same;
false
otherwise.Date.getTime()
public Object clone()
java.util.Date
Copyright © 2018 PostgreSQL Global Development Group. All rights reserved.