Difference between revisions of "Textutils.formatTime"
From ComputerCraft Wiki
m (Moved to CAT:APIFunctions) |
(Changing int to number) |
||
| Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=textutils.formatTime | |name=textutils.formatTime | ||
| − | |args= | + | |args= {{type|number}} time, {{type|boolean}} isTwentyFourHour |
| − | |returns= | + | |returns={{type|string}} formatted time |
|api=textutils | |api=textutils | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
Revision as of 12:56, 18 July 2013
| Formats a time that is in float format. | |
| Syntax | textutils.formatTime(number time, boolean isTwentyFourHour) |
| Returns | string formatted time |
| Part of | ComputerCraft |
| API | textutils |
Examples
| Prints the Minecraft world time in 24-hour time. | |
| Code |
print(textutils.formatTime(os.time(), true)) |
| Output | Depends on the time of day in your world, it will look something like this: "17:30". |