Time Class
Contains methods for the Time primitive data type.
For more information on time, see Time Data Type.
The following are methods for Time.
-
Adds the specified number of hours to a Time.
-
addMilliseconds(additionalMilliseconds)
Adds the specified number of milliseconds to a Time.
-
Adds the specified number of minutes to a Time.
-
Adds the specified number of seconds to a Time.
-
Returns the hour component of a Time.
-
Returns the millisecond component of a Time.
-
Returns the minute component of a Time.
-
newInstance(hour, minutes, seconds, milliseconds)
Constructs a Time from Integer representations of the specified hour, minutes, seconds, and milliseconds. (UTC is assumed.)
-
Returns the second component of a Time.
Adds the specified number of hours to a Time.
public Time addHours(Integer additionalHours)
- additionalHours: Type: Integer
Type: Time
Adds the specified number of milliseconds to a Time.
public Time addMilliseconds(Integer additionalMilliseconds)
- additionalMilliseconds: Type: Integer
Type: Time
Adds the specified number of minutes to a Time.
public Time addMinutes(Integer additionalMinutes)
- additionalMinutes: Type: Integer
Type: Time
Adds the specified number of seconds to a Time.
public Time addSeconds(Integer additionalSeconds)
- additionalSeconds: Type: Integer
Type: Time
Returns the hour component of a Time.
public Integer hour()
Type: Integer
Returns the millisecond component of a Time.
public Integer millisecond()
Type: Integer
Returns the minute component of a Time.
public Integer minute()
Type: Integer
Constructs a Time from Integer representations of the specified hour, minutes, seconds, and milliseconds. (UTC is assumed.)
public static Time newInstance(Integer hour, Integer minutes, Integer seconds, Integer milliseconds)
Type: Time
The following example creates a time of 18:30:2:20 (UTC).
Returns the second component of a Time.
public Integer second()
Type: Integer