|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Date
java.sql.Date
public class Date
A Date class which can consume and produce dates in SQL Date format.
The SQL date format represents a date as yyyy-mm-dd. Note that this date format only deals with year, month and day values. There are no values for hours, minutes, seconds.
This contrasts with regular java.util.Date values, which include time values for hours, minutes, seconds, milliseconds.
Time points are handled as millisecond values - milliseconds since the epoch, January 1st 1970, 00:00:00.000 GMT. Time values passed to the java.sql.Date class are "normalized" to the time 00:00:00.000 GMT on the date implied by the time value.
| Constructor Summary | |
|---|---|
Date(int theYear,
int theMonth,
int theDay)
Deprecated. Please use the constructor Date(long) Constructs a Date
object corresponding to the supplied Year, Month and Day. |
|
Date(long theDate)
Creates a Date which corresponds to the day implied by the supplied theDate milliseconds time value. |
|
| Method Summary | |
|---|---|
int |
getHours()
Deprecated. This method is deprecated and must not be used. SQL Date values do not have an hours component. |
int |
getMinutes()
Deprecated. This method is deprecated and must not be used. SQL Date values do not have a minutes component. |
int |
getSeconds()
Deprecated. This method is deprecated and must not be used. SQL Date values do not have a seconds component. |
void |
setHours(int theHours)
Deprecated. This method is deprecated and must not be used. SQL Date values do not have an hours component. |
void |
setMinutes(int theMinutes)
Deprecated. This method is deprecated and must not be used. SQL Date values do not have a minutes component. |
void |
setSeconds(int theSeconds)
Deprecated. This method is deprecated and must not be used. SQL Date values do not have a seconds component. |
void |
setTime(long theTime)
Sets this date to a date supplied as a milliseconds value. |
String |
toString()
Produces a string representation of the Date in SQL format |
static Date |
valueOf(String dateString)
Creates a Date from a string representation of a date in SQL format. |
| Methods inherited from class java.util.Date |
|---|
after, before, clone, compareTo, equals, getDate, getDay, getMonth, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setMonth, setYear, toGMTString, toLocaleString, UTC |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated
public Date(int theYear,
int theMonth,
int theDay)
Date(long) Constructs a Date
object corresponding to the supplied Year, Month and Day.
theYear - the year, specified as the year minus 1900. Must be in the
range 0 to 8099.theMonth - the month, specified as a number with 0 = January. Must be in
the range 0 to 11.theDay - the day in the month. Must be in the range 1 to 31.public Date(long theDate)
theDate - -
a time value in milliseconds since the epoch - January 1 1970
00:00:00 GMT. The time value (hours, minutes, seconds,
milliseconds) stored in the Date object is adjusted to
correspond to 00:00:00 GMT on the day implied by the supplied
time value.| Method Detail |
|---|
@Deprecated public int getHours()
Date
getHours in class DateIllegalArgumentException - if this method is called@Deprecated public int getMinutes()
Date
getMinutes in class DateIllegalArgumentException - if this method is called@Deprecated public int getSeconds()
Date
getSeconds in class DateIllegalArgumentException - if this method is called@Deprecated public void setHours(int theHours)
Date
setHours in class DatetheHours - the number of hours to set
IllegalArgumentException - if this method is called@Deprecated public void setMinutes(int theMinutes)
Date
setMinutes in class DatetheMinutes - the number of minutes to set
IllegalArgumentException - if this method is called@Deprecated public void setSeconds(int theSeconds)
Date
setSeconds in class DatetheSeconds - the number of seconds to set
IllegalArgumentException - if this method is calledpublic void setTime(long theTime)
setTime in class DatetheTime - the time in milliseconds since the Epochpublic String toString()
toString in class Datepublic static Date valueOf(String dateString)
dateString - the string representation of a date in SQL format -
"yyyy-mm-dd".
IllegalArgumentException - if the format of the supplied string does not match the SQL
format.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||