getTime | Multi Theft Auto: Wiki Skip to content

getTime

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to get the current time in the game. If you want to get the real server time, use getRealTime.

Syntax

int,​ int getTime ( )

Returns

  • int: value1
  • int: value2

Returns two ints that represent hours and minutes.

Code Examples

shared
function currentTime()
local timehour, timeminute = getTime()
outputChatBox( "The current game time is "..timehour..":"..timeminute )
end
addCommandHandler("gettime", currentTime)

See Also

World Functions