public class Time extends Date
在java.util.Date类允许JDBC API鉴定为SQL TIME值薄包装。的Time类添加格式化和分析操作,支持时间值JDBC转义语法。
日期组件应设置为1970年1月1日的“零时代”值,不应访问。
| Constructor and Description |
|---|
Time(int hour, int minute, int second)
过时的。
使用需要以毫秒值代替此构造函数的构造函数
|
Time(long time)
使用毫秒时间价值构建
Time对象。
|
| Modifier and Type | Method and Description |
|---|---|
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)
过时的。
|
Instant |
toInstant()
此方法总是总是抛出UnsupportedOperationException,不应该因为SQL
Time值没有日期。
|
LocalTime |
toLocalTime()
将这一
LocalTime
Time对象。
|
String |
toString()
格式在JDBC逃逸时间格式的时间。
|
static Time |
valueOf(LocalTime time)
|
static Time |
valueOf(String s)
将JDBC中的逃逸时间格式的字符串到
Time价值。
|
after, before, clone, compareTo, equals, from, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC@Deprecated public Time(int hour, int minute, int second)
Time对象与给定的值初始化为小时,分钟和秒。该驱动程序将日期组件设置为1970年1月1日。任何方法,试图访问一个对象的
Time日期组件将
java.lang.IllegalArgumentException。
如果一个给定的参数是不确定的,则结果是不确定的。
hour - 0至23
minute -
second - 0至59
public 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对象集。
public static Time valueOf(String s)
Time价值。
s -格式“HH时间:MM:SS”
Time对象
public String toString()
toString 方法重写,继承类
Date
String:MM:SS格式
Date.toLocaleString(),
Date.toGMTString()
@Deprecated public int getYear()
TIME值没有一年的分量。
getYear 方法重写,继承类
Date
IllegalArgumentException
setYear(int)
@Deprecated public int getMonth()
TIME值已经一个月没有分量。
getMonth 方法重写,继承类
Date
IllegalArgumentException
setMonth(int)
@Deprecated public int getDay()
TIME值没有一天分量。
getDay 方法重写,继承类
Date
IllegalArgumentException
Calendar
@Deprecated public int getDate()
TIME值没有日期。
getDate 方法重写,继承类
Date
IllegalArgumentException
setDate(int)
@Deprecated public void setYear(int i)
TIME值没有一年的分量。
setYear 方法重写,继承类
Date
i -年值。
IllegalArgumentException
getYear()
@Deprecated public void setMonth(int i)
TIME值已经一个月没有分量。
setMonth 方法重写,继承类
Date
i之间的月值0-11。
IllegalArgumentException
getMonth()
@Deprecated public void setDate(int i)
TIME值没有日期。
setDate 方法重写,继承类
Date
i之间的价值天月1-31。
IllegalArgumentException
getDate()
public static Time valueOf(LocalTime time)
time -
LocalTime转换
Time对象
NullPointerException -如果
time是空的
public LocalTime toLocalTime()
LocalTime
Time对象。
转换创建一个LocalTime表示相同的小时,分钟,和第二时间价值这Time。
LocalTime对象
public Instant toInstant()
Time值没有日期。
toInstant 方法重写,继承类
Date
Date对象
UnsupportedOperationException
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.