public class TimeOfDay extends Object implements Serializable
The hour is in 24-hour convention, meaning values are from 0 to 23.
DailyTimeIntervalScheduleBuilder
,
Serialized FormConstructor and Description |
---|
TimeOfDay(int hour,
int minute)
Create a TimeOfDay instance for the given hour and minute (at the zero second of the minute).
|
TimeOfDay(int hour,
int minute,
int second)
Create a TimeOfDay instance for the given hour, minute and second.
|
Modifier and Type | Method and Description |
---|---|
boolean |
before(TimeOfDay timeOfDay)
Determine with this time of day is before the given time of day.
|
boolean |
equals(Object obj) |
int |
getHour()
The hour of the day (between 0 and 23).
|
int |
getMinute()
The minute of the hour.
|
int |
getSecond()
The second of the minute.
|
Date |
getTimeOfDayForDate(Date dateTime)
Return a date with time of day reset to this object values.
|
int |
hashCode() |
static TimeOfDay |
hourAndMinuteAndSecondFromDate(Date dateTime)
Create a TimeOfDay from the given date, in the system default TimeZone.
|
static TimeOfDay |
hourAndMinuteAndSecondFromDate(Date dateTime,
TimeZone tz)
Create a TimeOfDay from the given date, in the given TimeZone.
|
static TimeOfDay |
hourAndMinuteFromDate(Date dateTime)
Create a TimeOfDay from the given date (at the zero-second), in the system default TimeZone.
|
static TimeOfDay |
hourAndMinuteFromDate(Date dateTime,
TimeZone tz)
Create a TimeOfDay from the given date (at the zero-second), in the system default TimeZone.
|
static TimeOfDay |
hourAndMinuteOfDay(int hour,
int minute)
Create a TimeOfDay instance for the given hour and minute (at the zero second of the minute).
|
static TimeOfDay |
hourMinuteAndSecondOfDay(int hour,
int minute,
int second)
Create a TimeOfDay instance for the given hour, minute and second.
|
String |
toString() |
public TimeOfDay(int hour, int minute, int second)
hour
- The hour of day, between 0 and 23.minute
- The minute of the hour, between 0 and 59.second
- The second of the minute, between 0 and 59.IllegalArgumentException
- if one or more of the input values is out of their valid range.public TimeOfDay(int hour, int minute)
hour
- The hour of day, between 0 and 23.minute
- The minute of the hour, between 0 and 59.IllegalArgumentException
- if one or more of the input values is out of their valid range.public static TimeOfDay hourMinuteAndSecondOfDay(int hour, int minute, int second)
hour
- The hour of day, between 0 and 23.minute
- The minute of the hour, between 0 and 59.second
- The second of the minute, between 0 and 59.IllegalArgumentException
- if one or more of the input values is out of their valid range.public static TimeOfDay hourAndMinuteOfDay(int hour, int minute)
hour
- The hour of day, between 0 and 23.minute
- The minute of the hour, between 0 and 59.IllegalArgumentException
- if one or more of the input values is out of their valid range.public int getHour()
public int getMinute()
public int getSecond()
public boolean before(TimeOfDay timeOfDay)
public Date getTimeOfDayForDate(Date dateTime)
public static TimeOfDay hourAndMinuteAndSecondFromDate(Date dateTime)
dateTime
- The java.util.Date from which to extract Hour, Minute and Second.public static TimeOfDay hourAndMinuteAndSecondFromDate(Date dateTime, TimeZone tz)
dateTime
- The java.util.Date from which to extract Hour, Minute and Second.tz
- The TimeZone from which relate Hour, Minute and Second for the given date. If null, system default
TimeZone will be used.public static TimeOfDay hourAndMinuteFromDate(Date dateTime)
dateTime
- The java.util.Date from which to extract Hour and Minute.public static TimeOfDay hourAndMinuteFromDate(Date dateTime, TimeZone tz)
dateTime
- The java.util.Date from which to extract Hour and Minute.tz
- The TimeZone from which relate Hour and Minute for the given date. If null, system default
TimeZone will be used.Copyright 2001-2019, Terracotta, Inc.