Difference between revisions of "Os.time"
From ComputerCraft Wiki
m (Moved to CAT:LuaCoreFunctions) |
m (Updated references from "os" to "OS") |
||
Line 3: | Line 3: | ||
|name=os.time | |name=os.time | ||
|returns=The current in-game time. | |returns=The current in-game time. | ||
− | |api= | + | |api=OS |
|addon=ComputerCraft | |addon=ComputerCraft | ||
|desc=Returns the current in-game time. | |desc=Returns the current in-game time. |
Revision as of 14:09, 30 November 2012
Function os.time | |
Returns the current in-game time. | |
Syntax | os.time() |
Returns | The current in-game time. |
Part of | ComputerCraft |
API | OS |
Examples
Example | |
Prints current time in 12 hour format (with AM and PM). | |
Code |
local time = os.time() |
Example | |
Prints current time in 24 hour format. | |
Code |
local time = os.time() |
Additional Notes
- You must use textutils.formatTime() if you want to print the time in readable form.