| java.lang.Object | ||
| ↳ | java.util.Date | |
| ↳ | java.sql.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.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
This constructor is deprecated.
Please use the constructor Date(long) Constructs a Date
object corresponding to the supplied Year, Month and Day.
| |||||||||||
Creates a Date which corresponds to the day implied by the supplied
theDate milliseconds time value.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
This method is deprecated and must not be used. SQL Date
values do not have an hours component.
| |||||||||||
This method is deprecated.
This method is deprecated and must not be used. SQL Date
values do not have a minutes component.
| |||||||||||
This method is deprecated.
This method is deprecated and must not be used. SQL Date
values do not have a seconds component.
| |||||||||||
This method is deprecated.
This method is deprecated and must not be used. SQL Date
values do not have an hours component.
| |||||||||||
This method is deprecated.
This method is deprecated and must not be used. SQL Date
values do not have a minutes component.
| |||||||||||
This method is deprecated.
This method is deprecated and must not be used. SQL Date
values do not have a seconds component.
| |||||||||||
Sets this date to a date supplied as a milliseconds value.
| |||||||||||
Produces a string representation of the Date in SQL format
| |||||||||||
Creates a Date from a string representation of a date in SQL format.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.util.Date
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface java.lang.Comparable
| |||||||||||
This constructor is deprecated.Please use the constructor 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. |
Creates a Date which corresponds to the day implied by the supplied theDate milliseconds time value.
| 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. |
|---|
This method is deprecated.This method is deprecated and must not be used. SQL Date values do not have an hours component.
Returns the gregorian calendar hour of the day for this Date object.
| IllegalArgumentException | if this method is called |
|---|
This method is deprecated.This method is deprecated and must not be used. SQL Date values do not have a minutes component.
Returns the gregorian calendar minute of the hour for this Date object.
| IllegalArgumentException | if this method is called |
|---|
This method is deprecated.This method is deprecated and must not be used. SQL Date values do not have a seconds component.
Returns the gregorian calendar second of the minute for this Date object.
| IllegalArgumentException | if this method is called |
|---|
This method is deprecated.This method is deprecated and must not be used. SQL Date values do not have an hours component.
Sets the gregorian calendar hour of the day for this Date object.
| theHours | the number of hours to set |
|---|
| IllegalArgumentException | if this method is called |
|---|
This method is deprecated.This method is deprecated and must not be used. SQL Date values do not have a minutes component.
Sets the gregorian calendar minute of the hour for this Date object.
| theMinutes | the number of minutes to set |
|---|
| IllegalArgumentException | if this method is called |
|---|
This method is deprecated.This method is deprecated and must not be used. SQL Date values do not have a seconds component.
Sets the gregorian calendar second of the minute for this Date object.
| theSeconds | the number of seconds to set |
|---|
| IllegalArgumentException | if this method is called |
|---|
Sets this date to a date supplied as a milliseconds value. The date is set based on the supplied time value after removing any time elements finer than a day, based on zero GMT for that day.
| theTime | the time in milliseconds since the Epoch |
|---|
Produces a string representation of the Date in SQL format
Creates a Date from a string representation of a date in SQL format.
| 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. |
|---|