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())

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function 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

Grid paper.png  Example
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".




Grid paper.png  Example
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".