-
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
- This topic was modified 2 years, 8 months ago by . Reason: Removed tip addresses
- This topic was modified 2 years, 4 months ago by . Reason: Added params to customize format. Added test script
- This topic was modified 2 years, 4 months ago by . Reason: Changed test code
- This topic was modified 2 years, 4 months ago by . Reason: Changed test code
- This topic was modified 2 years, 4 months ago by . Reason: Changed a section header