GetTimeOfDay
Appearance
| Environment: | Mission Scripting | |
|---|---|---|
| Function: | GetTimeOfDay | |
| Function Description: | Converts a number of seconds into a formatted HH:MM:SS string in 24-hour format with exactly 8 characters by calculating hours, minutes, and seconds using modulo arithmetic and zero-padding each component. | |
| File Location: | cmm.timeFunctions.lua | |
| Syntax: | CMM.GetTimeOfDay( number or nil TimeNum ) | |
| Return Value: | string | |
| Parameters: | Name | Description |
| TimeNum | The number of seconds to convert into HH:MM:SS format; if nil or not a number, uses current absolute game time. | |
| Example: | GetTimeOfDay(3661) | |
| Example Description: | Returns "1:01:01" as 3661 seconds equals 1 hour, 1 minute, and 1 second, with each component properly padded to two digits. | |
| Related Functions: | ||
| Notes: | ||