textutils.formatTime
From ComputerCraft Wiki
Revision as of 20:21, 17 September 2012 by 174.50.19.204 (Talk) (Added new page for textutils.formatTime())
| Formats a time that is in float format. | |
| Syntax | textutils.formatTime(float time, boolean isTwentyFourHour) |
| Returns | string formatted time |
| Part of | ComputerCraft |
| API | textutils |
Examples
| Prints the local world time. | |
| Code |
print(textutils.formatTime(os.clock(), false)) |
| Output | Depends on the time of day in your world, but it will look something like this: "5:30 AM". |
| Prints the local world time. | |
| Code |
print(textutils.formatTime(os.clock(), true)) |
| Output | Depends on the time of day in your world, but it will look something like this: "17:30". |