java.lang.Object java.util.Date java.sql.Time
public class Time
A thin wrapper around the java.util.Date
class that allows the JDBC API to identify this as an SQL TIME
value. The Time
class adds formatting and parsing operations to support the JDBC escape syntax for time values.
The date components should be set to the "zero epoch" value of January 1, 1970 and should not be accessed.
Time(int hour, int minute, int second)
Time(long time)
Time
object using a milliseconds time value. Method Summary int
getDate()
int
getDay()
int
getMonth()
int
getYear()
void
setDate(int i)
void
setMonth(int i)
void
setTime(long time)
Time
object using a milliseconds time value. void
setYear(int i)
String
toString()
static Time
valueOf(String s)
Time
value. Methods inherited from class java.util.Date after, before, clone, compareTo, equals, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC
Time
@Deprecated public Time(int hour, int minute, int second)
Time
object initialized with the given values for the hour, minute, and second. The driver sets the date components to January 1, 1970. Any method that attempts to access the date components of a Time
object will throw a java.lang.IllegalArgumentException
.
The result is undefined if a given argument is out of bounds.
hour
- 0 to 23
minute
- 0 to 59
second
- 0 to 59
public Time(long time)
Time
object using a milliseconds time value.
time
- milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds before January 1, 1970, 00:00:00 GMT
public void setTime(long time)
Time
object using a milliseconds time value.
setTime
in class Date
time
- milliseconds since January 1, 1970, 00:00:00 GMT; a negative number is milliseconds before January 1, 1970, 00:00:00 GMT
public static Time valueOf(String s)
Time
value.
s
- time in format "hh:mm:ss"
Time
object
public String toString()
toString
in class Date
String
in hh:mm:ss format
Date.toLocaleString()
, Date.toGMTString()
@Deprecated public int getYear()
TIME
values do not have a year component.
getYear
in class Date
IllegalArgumentException
- if this method is invoked
setYear(int)
@Deprecated public int getMonth()
TIME
values do not have a month component.
getMonth
in class Date
IllegalArgumentException
- if this method is invoked
setMonth(int)
@Deprecated public int getDay()
TIME
values do not have a day component.
getDay
in class Date
IllegalArgumentException
- if this method is invoked
Calendar
@Deprecated public int getDate()
TIME
values do not have a date component.
getDate
in class Date
IllegalArgumentException
- if this method is invoked
setDate(int)
@Deprecated public void setYear(int i)
TIME
values do not have a year component.
setYear
in class Date
i
- the year value.
IllegalArgumentException
- if this method is invoked
getYear()
@Deprecated public void setMonth(int i)
TIME
values do not have a month component.
setMonth
in class Date
i
- the month value between 0-11.
IllegalArgumentException
- if this method is invoked
getMonth()
@Deprecated public void setDate(int i)
TIME
values do not have a date component.
setDate
in class Date
i
- the day of the month value between 1-31.
IllegalArgumentException
- if this method is invoked
getDate()
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4