Oolite JavaScript Reference: Clock

From Elite Wiki
Revision as of 15:28, 15 September 2007 by Ahruman (talk | contribs) (Documented shiny new clock.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Prototype: Object
Subtypes: none

The clock global object is used to tell the time. Apart from absoluteSeconds(), all its properties have to do with game clock time.

Properties

absoluteSeconds

absoluteSeconds : Number (read-only)

The game real time clock. Roughly speaking, this is the number of seconds since the game was started, not counting time in which it was paused.

seconds

seconds : Number (read-only)

The current time in game clock time, in seconds since the epoch. If the current clock time is 2084004:17:13:42, seconds will be at least 180058007622 and less than 180058007623.

See Also: secondsComponent

minutes

minutes : Number (read-only)

The current time in game clock time, in integer minutes since the epoch. If the current clock time is 2084004:17:13:42, minutes will be 3000966793.

See Also: minutesComponent

hours

hours : Number (read-only)

The current time in game clock time, in integer hours since the epoch. If the current clock time is 2084004:17:13:42, hours will be 50016113.

See Also: hoursComponent

days

days : Number (read-only)

The current time in game clock time, in integer days since the epoch. If the current clock time is 2084004:17:13:42, hours will be 2084004.

secondsComponent

secondsComponent : Number (read-only)

The second component of the clock time. If the current clock time is 2084004:17:13:42, secondsComponent will be 42.

See Also: seconds

minutesComponent

minutesComponent : Number (read-only)

The minute component of the clock time. If the current clock time is 2084004:17:13:42, minutesComponent will be 13.

See Also: minutes

hoursComponent

hoursComponent : Number (read-only)

The hour component of the clock time. If the current clock time is 2084004:17:13:42, hoursComponent will be 17.

See Also: hours

daysComponent

daysComponent : Number (read-only)

Same as days, included only for completeness.

clockString

clockString : String (read-only)

The clock as displayed in the HUD, including “(adjusting)” if appropriate. If the current clock time is 2084004:17:13:42 and the clock is not being adjusted, clockString will be “2084004:17:13:42”.

isAdjusting

isAdjusting : Boolean (read-only)

True if the clock is being adjusted, i.e. running faster than real time, as happens after jumps, after docking and when buying or selling items.