Time Class

Contains methods for the Time primitive data type.

System

For more information on time, see Time Data Type.

The following are methods for Time.

Adds the specified number of hours to a Time.

public Time addHours(Integer additionalHours)

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)

Type: Time

Adds the specified number of seconds to a Time.

public Time addSeconds(Integer additionalSeconds)

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