| java.lang.Object java.util.Date java.sql.Date java.sql.Timestamp
Timestamp | public class Timestamp extends Date (Code) | | A Java representation of the SQL TIMESTAMP type. It provides the capability
to represent the SQL TIMESTAMP nanosecond value, in addition to the regular
date/time value which has millisecond resolution.
The Timestamp class consists of a regular Date/Time value, where only the
integral seconds value is stored, plus a nanoseconds value where the
fractional seconds are stored.
The addition of the nanosecond value field to the Timestamp object makes it
significantly different from the java.util.Date object which it extends.
Users should be cautious in their use of Timestamp objects and should not
assume that they are interchangeable with java.util.Date objects when used
outside the confines of the java.sql package.
|
Constructor Summary | |
public | Timestamp(int theYear, int theMonth, int theDate, int theHour, int theMinute, int theSecond, int theNano) | public | Timestamp(long theTime) Returns a Timestamp object corresponding to the time represented by a
supplied time value. |
Timestamp | public Timestamp(int theYear, int theMonth, int theDate, int theHour, int theMinute, int theSecond, int theNano) throws IllegalArgumentException(Code) | | Parameters: theYear - specified as the year minus 1900 Parameters: theMonth - specified as an integer in the range 0 - 11 Parameters: theDate - specified as an integer in the range 1 - 31 Parameters: theHour - specified as an integer in the range 0 - 23 Parameters: theMinute - specified as an integer in the range 0 - 59 Parameters: theSecond - specified as an integer in the range 0 - 59 Parameters: theNano - which defines the nanosecond value of the timestamp specifiedas an integer in the range 0 - 999,999,999 throws: IllegalArgumentException - if any of the parameters is out of range |
Timestamp | public Timestamp(long theTime)(Code) | | Returns a Timestamp object corresponding to the time represented by a
supplied time value.
Parameters: theTime - a time value in the format of milliseconds since the Epoch(January 1 1970 00:00:00.000 GMT) |
after | public boolean after(Timestamp theTimestamp)(Code) | | Returns true if this timestamp object is later than the supplied
timestamp, otherwise returns false.
Parameters: theTimestamp - the timestamp to compare with this timestamp object true if this timestamp object is later than the suppliedtimestamp, false otherwise |
before | public boolean before(Timestamp theTimestamp)(Code) | | Returns true if this timestamp object is earlier than the supplied
timestamp, otherwise returns false.
Parameters: theTimestamp - the timestamp to compare with this timestamp object true if this timestamp object is earlier than the suppliedtimestamp, false otherwise |
compareTo | public int compareTo(Date theObject) throws ClassCastException(Code) | | Compares this Timestamp object with a supplied Timestamp object
Parameters: theObject - the timestamp to compare with this timestamp object, passed inas an Object 0 if the two Timestamp objects are equal in time, a value <0 ifthis Timestamp object is before the supplied Timestamp and avalue >0 if this Timestamp object is after the supplied Timestamp throws: ClassCastException - if the supplied object is not a Timestamp object |
compareTo | public int compareTo(Timestamp theTimestamp)(Code) | | Compares this Timestamp object with a supplied Timestamp object
Parameters: theTimestamp - the timestamp to compare with this timestamp object, passed inas a Timestamp 0 if the two Timestamp objects are equal in time, a value <0 ifthis Timestamp object is before the supplied Timestamp and avalue >0 if this Timestamp object is after the supplied Timestamp |
equals | public boolean equals(Object theObject)(Code) | | Tests to see if this timestamp is equal to a supplied object.
Parameters: theObject - true if this Timestamp object is equal to the supplied Timestampobject false if the object is not a Timestamp object or if theobject is a Timestamp but represents a different instant in time |
equals | public boolean equals(Timestamp theTimestamp)(Code) | | Tests to see if this timestamp is equal to a supplied timestamp.
Parameters: theTimestamp - the timestamp to compare with this timestamp object, passed inas an Object true if this Timestamp object is equal to the supplied Timestampobject |
getNanos | public int getNanos()(Code) | | Gets this Timestamp's nanosecond value
The timestamp's nanosecond value, an integer between 0 and999,999,999 |
getTime | public long getTime()(Code) | | Returns the time represented by this Timestamp object, as a long value
containing the number of milliseconds since the Epoch (January 1 1970,
00:00:00.000 GMT)
|
setTime | public void setTime(long theTime)(Code) | | Sets the time represented by this Timestamp object to the supplied time,
defined as the number of milliseconds since the Epoch (January 1 1970,
00:00:00.000 GMT)
|
toString | public String toString()(Code) | | Returns the timestamp formatted as a String in the JDBC Timestamp Escape
format, which is of the form "yyyy-mm-dd hh:mm:ss.nnnnnnnnn"
A string representing the instant defined by the Timestamp, inJDBC Timestamp escape format |
valueOf | public static Timestamp valueOf(String s) throws IllegalArgumentException(Code) | | Creates a Timestamp object with a time value equal to the time specified
by a supplied String holding the time in JDBC timestamp escape format,
which is of the form "yyyy-mm-dd hh:mm:ss.nnnnnnnnn"
Parameters: s - the String containing a time in JDBC timestamp escape format A timestamp object with time value as defined by the suppliedString |
|
|