Jump to content

GetTimeOfDay

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (GetTimeOfDay – created via PowerShell script (2025-11-11T21:12:47Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
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
TimeNumThe 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: