Name
Timestamp
Synopsis
Class Name:
java.sql.Timestamp
Superclass: java.util.Date
Immediate Subclasses: None
Interfaces Implemented: None
Availability: JDK 1.1
Description
This class serves as a SQL representation of the Java
Date class specifically designed to serve as a SQL
TIMESTAMP. It also provides the ability to hold
nanoseconds as required by SQL TIMESTAMP values.
You should keep in mind that this class uses the
java.util.Date version of hashcode( ). This means that two timestamps that differ only by
nanoseconds will have identical hashcode() return
values.
Class Summary
public class Timestamp extends java.util.Date {
static public Timestamp valueOf(String s);
#public Timestamp(int year, int month, int date,
int hour, int minute, int second, int nano);
public Timestamp(long time);
public boolean after(Timestamp t);
public boolean before(Timestamp t);
public boolean equals(Timestamp t);
public int getNanos( );
public void setNanos(int n);
public String toString( );
}Object Constructors
Timestamp( )
public Timestamp(int year, int month, int date, int hour, int minute, int second, int nano) public Timestamp(long time)
- Description
This constructor creates a new
Timestampobject. The first prototype constructs aTimestampfor the year, month, date, hour, minute, second, and nanosecond specified. The second prototype constructs one based on the number of seconds since January 1, 1970, 12:00:00 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access