Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetComputerTime

From RoR Wiki

UI Lua API · Time functions
Version: WAR 1.4.8

Returns the time of day on the computer's clock, in seconds since midnight.

seconds = GetComputerTime()

Arguments

None.

Returns

seconds
number – Seconds since local midnight, 0 to 86399.

Details

  • The value is computed from the computer's local time as (hour * 60 + minute) * 60 + second.
  • Arguments are not checked; anything passed is ignored.
  • The stock UI never calls GetComputerTime.

Errors

None.

Example

A minimal example built from the signature above:

local seconds = GetComputerTime()
local hour    = math.floor( seconds / 3600 )
local minute  = math.floor( ( seconds % 3600 ) / 60 )

See also