java.lang.Object
com.pervasive.datarush.tokens.scalar.TimeOfDay
A specific moment of time on a 24-hour clock. A
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 ZoneId
to produce a specific instant.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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.Constructs an instance representing the current time in the specified timezone.Constructs an instance representing the specified time in the given timezone. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGet the hour portion, in 24-hour format, of the time of day.intGet the number of milliseconds elapsed since midnightintGet the minutes portion of the time of day.intGet the seconds portion of the time of day.intGet the millisecond portion of the time of day.inthashCode()static intnow()Gets the current time of day in the default time zone as milliseconds since midnight.static intGets the current time of day in the specified time zone as milliseconds since midnight.toString()
-
Constructor Details
-
TimeOfDay
public TimeOfDay()Constructs an instance representing the current time in the default timezone. -
TimeOfDay
Constructs an instance representing the current time in the specified timezone.- Parameters:
zoneId- the zone id 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
-
TimeOfDay
Constructs an instance representing the specified time in the given timezone.- Parameters:
time- the instant in time from which to extract time informationzoneId- the zone id in which to interpret the specified instant
-
-
Method Details
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-
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
Gets the current time of day in the specified time zone as milliseconds since midnight.- Parameters:
zoneId- the zone id relative to which to interpret the current time- Returns:
- the number of milliseconds elapsed since midnight
-