public class Time extends Date
This class extends the standard java.util.date class to represent SQL TIME types. Only hours, minutes, and seconds are handled. It supports the JDBC escape syntax for time values.
Time
public Time(int hour, int minute, int second)
This constructs a Time object.
Parameters:
hour: | 0 to 23 |
minute: | 0 to 59 |
second: | 0 to 59 |
Time
public Time(long time)
This constructs a Time object using a time value in milliseconds since January 1, 1970, 00:00:00 GMT.
Parameters:
time: | The milliseconds since January 1, 1970, 00:00:00 GMT |
toString
public String toString()
This converts the time to HH:MM:SS format.
Returns: A HH:MM:SS formatted time String
valueOf
public static Time valueOf(String s)
This converts an HH:MM:SS formatted string to a Time value.
Parameters:
s: | The time in HH:MM:SS format |
Returns: A Time object