| Method from java.sql.Date Detail: |
public int getHours() {
throw new java.lang.IllegalArgumentException();
} Deprecated!
This method is deprecated and should not be used because SQL Date
values do not have a time component. |
public int getMinutes() {
throw new java.lang.IllegalArgumentException();
} Deprecated!
This method is deprecated and should not be used because SQL Date
values do not have a time component. |
public int getSeconds() {
throw new java.lang.IllegalArgumentException();
} Deprecated!
This method is deprecated and should not be used because SQL Date
values do not have a time component. |
public void setHours(int i) {
throw new java.lang.IllegalArgumentException();
} Deprecated!
This method is deprecated and should not be used because SQL Date
values do not have a time component. |
public void setMinutes(int i) {
throw new java.lang.IllegalArgumentException();
} Deprecated!
This method is deprecated and should not be used because SQL Date
values do not have a time component. |
public void setSeconds(int i) {
throw new java.lang.IllegalArgumentException();
} Deprecated!
This method is deprecated and should not be used because SQL Date
values do not have a time component. |
public void setTime(long date) {
// If the millisecond date value contains time info, mask it out.
super.setTime(date);
}
Sets an existing Date object
using the given milliseconds time value.
If the given milliseconds value contains time information,
the driver will set the time components to the
time in the default time zone (the time zone of the Java virtual
machine running the application) that corresponds to zero GMT. |
public String toString() {
int year = super.getYear() + 1900;
int month = super.getMonth() + 1;
int day = super.getDate();
char buf[] = "2000-00-00".toCharArray();
buf[0] = Character.forDigit(year/1000,10);
buf[1] = Character.forDigit((year/100)%10,10);
buf[2] = Character.forDigit((year/10)%10,10);
buf[3] = Character.forDigit(year%10,10);
buf[5] = Character.forDigit(month/10,10);
buf[6] = Character.forDigit(month%10,10);
buf[8] = Character.forDigit(day/10,10);
buf[9] = Character.forDigit(day%10,10);
return new String(buf);
}
Formats a date in the date escape format yyyy-mm-dd.
|
public static Date valueOf(String s) {
int year;
int month;
int day;
int firstDash;
int secondDash;
if (s == null) throw new java.lang.IllegalArgumentException();
firstDash = s.indexOf('-");
secondDash = s.indexOf('-", firstDash+1);
if ((firstDash > 0) & (secondDash > 0) & (secondDash < s.length()-1)) {
year = Integer.parseInt(s.substring(0, firstDash)) - 1900;
month = Integer.parseInt(s.substring(firstDash+1, secondDash)) - 1;
day = Integer.parseInt(s.substring(secondDash+1));
} else {
throw new java.lang.IllegalArgumentException();
}
return new Date(year, month, day);
}
Converts a string in JDBC date escape format to
a Date value. |