-
Formats a unix datetime number (to “YYYY-MM-DD at HH:MM” by default).
Custom Command Dependencies:
NoneTest Script:
if not Load('done', false) then local dateDelimiter local dateTimeDelimiter local timeDelimiter local includeSeconds local includeTime local includeYear local unix = Time() local formatted = CC_FormatDateTime(unix) Log(' ') Log(formatted) Log('Formatted Default:') Log(' ') includeSeconds = true local formatted1 = CC_FormatDateTime(unix, dateDelimiter, dateTimeDelimiter, timeDelimiter, includeSeconds, includeTime, includeYear) Log(formatted1) Log('With Seconds:') Log(' ') includeTime = false local formatted2 = CC_FormatDateTime(unix, dateDelimiter, dateTimeDelimiter, timeDelimiter, includeSeconds, includeTime, includeYear) Log(formatted2) Log('Without Time:') Log(' ') includeTime = true includeYear = false local formatted3 = CC_FormatDateTime(unix, dateDelimiter, dateTimeDelimiter, timeDelimiter, includeSeconds, includeTime, includeYear) Log(formatted3) Log('Without Year:') Log(' ') dateDelimiter = '/' dateTimeDelimiter = ' - ' timeDelimiter = '.' includeSeconds = true includeTime = true includeYear = true local formatted4 = CC_FormatDateTime(unix, dateDelimiter, dateTimeDelimiter, timeDelimiter, includeSeconds, includeTime, includeYear) Log(formatted4) Log('Formatted Another Way:') Log(' ') Save('done', true) end