- java.lang.Object
-
- com.pervasive.datarush.tokens.scalar.TimeOfDay
-
public final class TimeOfDay extends Object
A specific moment of time on a 24-hour clock. ATimeOfDay
contains only time information, up to millisecond precision.A
TimeOfDay
only partially specifies an instant in the time continuum; it must be combined with aCalendarDate
andTimeZone
to produce a specific instant.- See Also:
Time
-
-
Constructor Summary
Constructors Constructor Description TimeOfDay()
Constructs an instance representing the current time in the default timezone.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(Date time, TimeZone tz)
Constructs an instance representing the specified time in the given time zone.TimeOfDay(TimeZone tz)
Constructs an instance representing the current time in the specified timezone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 midnightint
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.String
toString()
-
-
-
Constructor Detail
-
TimeOfDay
public TimeOfDay()
Constructs an instance representing the current time in the default timezone.
-
TimeOfDay
public TimeOfDay(TimeZone tz)
Constructs an instance representing the current time in the specified timezone.- Parameters:
tz
- the timezone to which the current time is relative
-
TimeOfDay
public TimeOfDay(int dayMillis)
Constructs an instance representing the time occurring the specified number of milliseconds after midnight.- Parameters:
dayMillis
- the number of milliseconds elapsed since midnight
-
TimeOfDay
public TimeOfDay(int hourOfDay, int minuteOfHour)
Constructs an instance representing the specified time, expressed in 24-hour format.- Parameters:
hourOfDay
- the hour portion of the timeminuteOfHour
- the minute portion of the time
-
TimeOfDay
public TimeOfDay(int hourOfDay, int minuteOfHour, int secondOfMinute)
Constructs an instance representing the specified time, expressed using 24-hour format.- Parameters:
hourOfDay
- the hour portion of the timeminuteOfHour
- the minutes portion of the timesecondOfMinute
- the seconds portion of the time
-
-
Method Detail
-
getMillisSinceMidnight
public int getMillisSinceMidnight()
Get the number of milliseconds elapsed since midnight- Returns:
- milliseconds elapsed since midnight
-
getHourOfDay
public int getHourOfDay()
Get the hour portion, in 24-hour format, of the time of day.- Returns:
- the hour of the day
-
getMinuteOfHour
public int getMinuteOfHour()
Get the minutes portion of the time of day.- Returns:
- the minute within the hour
-
getSecondOfMinute
public int getSecondOfMinute()
Get the seconds portion of the time of day.- Returns:
- the second within the minute
-
getSubsecondMillis
public int getSubsecondMillis()
Get the millisecond portion of the time of day.- Returns:
- the milliseconds within the second
-
now
public static int now()
Gets the current time of day in the default time zone as milliseconds since midnight.- Returns:
- the number of milliseconds elapsed since midnight
-
now
public static int now(TimeZone tz)
Gets the current time of day in the specified time zone as milliseconds since midnight.- Parameters:
tz
- the time zone relative to which to interpret the current time- Returns:
- the number of milliseconds elapsed since midnight
-
-