|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.util.Date
java.sql.Time
public class Time
一個與 java.util.Date 類別有關的精簡型外覆器 (thin wrapper),它允許 JDBC 將該類別標識為 SQL TIME 值。Time 類別添加格式化和解析操作以支持時間值的 JDBC 轉義語法。
應該將日期元件設置為 1970 年 1 月 1 日的 "zero epoch" 值並且不應存取該值。
| 建構子摘要 | |
|---|---|
Time(int hour,
int minute,
int second)
已過時。 使用採用毫秒值的建構子取代此建構子 |
|
Time(long time)
使用毫秒時間值建構 Time 物件。 |
|
| 方法摘要 | |
|---|---|
int |
getDate()
已過時。 |
int |
getDay()
已過時。 |
int |
getMonth()
已過時。 |
int |
getYear()
已過時。 |
void |
setDate(int i)
已過時。 |
void |
setMonth(int i)
已過時。 |
void |
setTime(long time)
使用毫秒時間值設置 Time 物件。 |
void |
setYear(int i)
已過時。 |
String |
toString()
使用 JDBC 時間轉義格式對時間進行格式化。 |
static Time |
valueOf(String s)
將使用 JDBC 時間轉義格式的字元串轉換為 Time 值。 |
| 從類別 java.util.Date 繼承的方法 |
|---|
after, before, clone, compareTo, equals, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC |
| 從類別 java.lang.Object 繼承的方法 |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| 建構子詳細資訊 |
|---|
@Deprecated
public Time(int hour,
int minute,
int second)
Time 物件,用小時、分鐘和秒鐘的給定值對其進行初始化。驅動程序將日期元件設置為 1970 年 1 月 1 日。嘗試存取 Time 物件的日期元件的任何方法都將拋出 java.lang.IllegalArgumentException。
如果給定的參數超出範圍,則結果是不確定的。
hour - 0 到 23minute - 0 到 59second - 0 到 59public Time(long time)
Time 物件。
time - 自從 1970 年 1 月 1 日 00:00:00 GMT 以來的毫秒數;負數表示在 1970 年 1 月 1 日 00:00:00 GMT 之前的毫秒數| 方法詳細資訊 |
|---|
public void setTime(long time)
Time 物件。
Date 中的 setTimetime - 自從 1970 年 1 月 1 日 00:00:00 GMT 以來的毫秒數;負數表示在 1970 年 1 月 1 日 00:00:00 GMT 之前的毫秒數public static Time valueOf(String s)
Time 值。
s - 使用 "hh:mm:ss" 格式的時間
Time 物件public String toString()
Date 中的 toStringStringDate.toLocaleString(),
Date.toGMTString()@Deprecated public int getYear()
TIME 值沒有年 (year) 元件。
Date 中的 getYearIllegalArgumentException - 如果調用此方法setYear(int)@Deprecated public int getMonth()
TIME 值沒有月 (month) 元件。
Date 中的 getMonthIllegalArgumentException - 如果調用此方法setMonth(int)@Deprecated public int getDay()
TIME 值沒有日 (day) 元件。
Date 中的 getDayIllegalArgumentException - 如果調用此方法Calendar@Deprecated public int getDate()
TIME 值沒有日期 (date) 元件。
Date 中的 getDateIllegalArgumentException - 如果調用此方法setDate(int)@Deprecated public void setYear(int i)
TIME 值沒有年 (year) 元件。
Date 中的 setYeari - 年份值。
IllegalArgumentException - 如果調用此方法getYear()@Deprecated public void setMonth(int i)
TIME 值沒有月 (month) 元件。
Date 中的 setMonthi - 0-11 之間的月份值。
IllegalArgumentException - 如果調用此方法getMonth()@Deprecated public void setDate(int i)
TIME 值沒有日期 (date) 元件。
Date 中的 setDatei - 月份中 1-31 之間的某一天。
IllegalArgumentException - 如果調用此方法getDate()
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。