Newer Version Available
Time Class
Contains methods for the Time primitive data type.
Namespace
Usage
For more information on time, see Time Data Type.
Time Methods
The following are methods for Time.
hour()
Returns the hour component of a Time.
Signature
public Integer hour()
Return Value
Type: Integer
Example
millisecond()
Returns the millisecond component of a Time.
Signature
public Integer millisecond()
Return Value
Type: Integer
Example
minute()
Returns the minute component of a Time.
Signature
public Integer minute()
Return Value
Type: Integer
Example
newInstance(hour, minutes, seconds, milliseconds)
Constructs a Time from Integer representations of the specified hour, minutes, seconds,
and milliseconds. (UTC is assumed.)
Signature
public static Time newInstance(Integer hour, Integer minutes, Integer seconds, Integer milliseconds)
Parameters
Return Value
Type: Time
Example
The following example creates a time of 18:30:2:20 (UTC).
second()
Returns the second component of a Time.
Signature
public Integer second()
Return Value
Type: Integer