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
String
in the form ofyyyy-mm-dd
, this method will return a corresponding instance of theDate
class representing that date.
Object Constructors
Date( )
public Date(long date) public Date(int year, int month, int day)
- Description
Date
( )
constructs a newDate
instance. Constructing aDate
requires 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
Date
object to the specified number of milliseconds ...
Get Database Programming with JDBC & Java, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.