os.time

From ComputerCraft Wiki
Revision as of 22:38, 3 June 2014 by MKlegoman357 (Talk | contribs) (Fixed/Expanded)

Jump to: navigation, search


Grid Redstone.png  Function os.time
Returns the current in-game time.
Syntax os.time()
Returns number the current in-game time
Part of ComputerCraft
API OS

Examples

Grid paper.png  Example
Prints current time in 12 hour format (with AM and PM).
Code
local time = os.time()
local formattedTime = textutils.formatTime(time, false)

print("The time is " .. formattedTime)

Additional Notes