Name
Date
Synopsis
Class Name:
java.sql.Date
Superclass: java.util.Date
Immediate Subclasses: None
Interfaces Implemented: None
Availability: JDK 1.1
Description
This class deals with a subset of functionality found in the
java.util.Date class. It specifically worries only
about days and ignores hours, minutes, and seconds.
Class Summary
public class Date extends java.util.Date {
static public Date valueOf(String s);
#public Date(int year, int month, int day);
public Date(long date);
public void setTime(long date);
public String toString( );
}Class Methods
valueOf( )
static public Date valueOf(String s)
- Description
Given a
Stringin the form ofyyyy-mm-dd, this method will return a corresponding instance of theDateclass representing that date.
Object Constructors
Date( )
public Date(long date)public Date(int year, int month, int day)
- Description
Date( )constructs a newDateinstance. Constructing aDaterequires use of the new JDK 1.2Date(long)constructor. The date argument specifies the number of milliseconds since January 1, 1970 00:00:00 GMT. A negative number represents the milliseconds before that date. The second, deprecated constructor naturally should never be used since it is ambiguous with respect to calendar and time zone.
Object Methods
setTime( )
public void setTime(long date)
- Description
This method sets the time represented by this
Dateobject to the specified number of milliseconds ...
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