API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.sql. Timestamp View Source
Author(s)
Since
Version
Serial
Hierarchy
 Object
      Date
          Timestamp
Implements
Subclasses
Description
public class Timestamp
  A thin wrapper around java.util.Date that allows the JDBC API to identify this as an SQL TIMESTAMP value.
See also:   
Constructors
@Deprecated
public Timestamp (int year, int month, int date, int hour, int minute, int second, int nano)
  Constructs a Timestamp object initialized with the given values.
public Timestamp (long time)
  Constructs a Timestamp object using a milliseconds time value.
Methods
Hide/Show inherited methods
public boolean after (Date when) [Inherited From Date]
  Tests if this date is after the specified date.
public boolean after (Timestamp ts)
  Indicates whether this Timestamp object is later than the given Timestamp object.
public boolean before (Date when) [Inherited From Date]
  Tests if this date is before the specified date.
public boolean before (Timestamp ts)
  Indicates whether this Timestamp object is earlier than the given Timestamp object.
public Object clone () [Inherited From Date]
Return a copy of this object.
public int compareTo (Date o) [Overrides Date]
  Compares this Timestamp object to the given Date, which must be a Timestamp object.
public int compareTo (Timestamp ts)
  Compares this Timestamp object to the given Timestamp object.
public boolean equals (Object ts) [Overrides Date]
  Tests to see if this Timestamp object is equal to the given object.
public boolean equals (Timestamp ts)
  Tests to see if this Timestamp object is equal to the given Timestamp object.
@Deprecated
public int getDate () [Inherited From Date]
  Returns the day of the month represented by this Date object.
@Deprecated
public int getDay () [Inherited From Date]
  Returns the day of the week represented by this date.
@Deprecated
public int getHours () [Inherited From Date]
  Returns the hour represented by this Date object.
@Deprecated
public int getMinutes () [Inherited From Date]
  Returns the number of minutes past the hour represented by this date, as interpreted in the local time zone.
@Deprecated
public int getMonth () [Inherited From Date]
  Returns a number representing the month that contains or begins with the instant in time represented by this Date object.
public int getNanos ()
  Gets this Timestamp object's nanos value.
@Deprecated
public int getSeconds () [Inherited From Date]
  Returns the number of seconds past the minute represented by this date.
public long getTime () [Overrides Date]
  Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Timestamp object.
@Deprecated
public int getTimezoneOffset () [Inherited From Date]
  Returns the offset, measured in minutes, for the local time zone relative to UTC that is appropriate for the time represented by this Date object.
@Deprecated
public int getYear () [Inherited From Date]
  Returns a value that is the result of subtracting 1900 from the year that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone.
public int hashCode () [Inherited From Date]
  Returns a hash code value for this object.
@Deprecated
publicstatic long parse (String s) [Inherited From Date]
  Attempts to interpret the string s as a representation of a date and time.
@Deprecated
public void setDate (int date) [Inherited From Date]
  Sets the day of the month of this Date object to the specified value.
@Deprecated
public void setHours (int hours) [Inherited From Date]
  Sets the hour of this Date object to the specified value.
@Deprecated
public void setMinutes (int minutes) [Inherited From Date]
  Sets the minutes of this Date object to the specified value.
@Deprecated
public void setMonth (int month) [Inherited From Date]
  Sets the month of this date to the specified value.
public void setNanos (int n)
  Sets this Timestamp object's nanos field to the given value.
@Deprecated
public void setSeconds (int seconds) [Inherited From Date]
  Sets the seconds of this Date to the specified value.
public void setTime (long time) [Overrides Date]
  Sets this Timestamp object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
@Deprecated
public void setYear (int year) [Inherited From Date]
  Sets the year of this Date object to be the specified value plus 1900.
@Deprecated
public String toGMTString () [Inherited From Date]
  Creates a string representation of this Date object of the form:
where:
  • d is the day of the month (1 through 31), as one or two decimal digits.
  • mon is the month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
  • yyyy is the year, as four decimal digits.
  • hh is the hour of the day (00 through 23), as two decimal digits.
  • mm is the minute within the hour (00 through 59), as two decimal digits.
  • ss is the second within the minute (00 through 61), as two decimal digits.
  • GMT is exactly the ASCII letters "GMT" to indicate Greenwich Mean Time.

The result does not depend on the local time zone.
Returns: a string representation of this date, using the Internet GMT conventions.
See Also: DateFormat, Date.toString(), Date.toLocaleString(),

@Deprecated
public String toLocaleString () [Inherited From Date]
  Creates a string representation of this Date object in an implementation-dependent form.
public String toString () [Overrides Date]
  Formats a timestamp in JDBC timestamp escape format.
@Deprecated
publicstatic long UTC (int year, int month, int date, int hrs, int min, int sec) [Inherited From Date]
  Determines the date and time based on the arguments.
publicstatic Timestamp valueOf (String s)
  Converts a String object in JDBC timestamp escape format to a Timestamp value.
Fields
Hide/Show inherited fields
pack-privatefinalstatic long serialVersionUID = "2745179027874758501"
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar