public final class TimeOfDay extends Object
TimeOfDay
contains only time information,
up to millisecond precision.
A TimeOfDay
only partially specifies an instant in the time continuum;
it must be combined with a CalendarDate
and TimeZone
to produce a specific
instant.
Time
Constructor and Description |
---|
TimeOfDay()
Constructs an instance representing the current time in the default timezone.
|
TimeOfDay(Date time,
TimeZone tz)
Constructs an instance representing the specified time in the given time zone.
|
TimeOfDay(int dayMillis)
Constructs an instance representing the time occurring the specified number
of milliseconds after midnight.
|
TimeOfDay(int hourOfDay,
int minuteOfHour)
Constructs an instance representing the specified time, expressed in
24-hour format.
|
TimeOfDay(int hourOfDay,
int minuteOfHour,
int secondOfMinute)
Constructs an instance representing the specified time, expressed using
24-hour format.
|
TimeOfDay(TimeZone tz)
Constructs an instance representing the current time in the specified timezone.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getHourOfDay()
Get the hour portion, in 24-hour format, of the time of day.
|
int |
getMillisSinceMidnight()
Get the number of milliseconds elapsed since midnight
|
int |
getMinuteOfHour()
Get the minutes portion of the time of day.
|
int |
getSecondOfMinute()
Get the seconds portion of the time of day.
|
int |
getSubsecondMillis()
Get the millisecond portion of the time of day.
|
int |
hashCode() |
static int |
now()
Gets the current time of day in the default time zone as milliseconds
since midnight.
|
static int |
now(TimeZone tz)
Gets the current time of day in the specified time zone as milliseconds
since midnight.
|
public TimeOfDay()
public TimeOfDay(TimeZone tz)
tz
- the timezone to which the current time is relativepublic TimeOfDay(int dayMillis)
dayMillis
- the number of milliseconds elapsed since midnightpublic TimeOfDay(int hourOfDay, int minuteOfHour)
hourOfDay
- the hour portion of the timeminuteOfHour
- the minute portion of the timepublic TimeOfDay(int hourOfDay, int minuteOfHour, int secondOfMinute)
hourOfDay
- the hour portion of the timeminuteOfHour
- the minutes portion of the timesecondOfMinute
- the seconds portion of the timepublic int getMillisSinceMidnight()
public int getHourOfDay()
public int getMinuteOfHour()
public int getSecondOfMinute()
public int getSubsecondMillis()
public static int now()
public static int now(TimeZone tz)
tz
- the time zone relative to which to interpret the current timeCopyright © 2019 Actian Corporation. All rights reserved.