FormatDuration
Formats a duration into a special format.
Syntax
FormatDuration duration_to_format "format"
Returns
text value
Arguments
| Name | Required | Type | Description |
|---|---|---|---|
duration to format | Yes | Duration in format #ms, #s, #m, #h (e.g. 5s or 2m) | |
format | Yes | Any text e.g. "Hello, World!" | Use these tags to format your time: DD for days, HH for hours, MM for minutes, and SS for seconds. You can separate them with colons (:) or dashes (-). |
Details
Here are some examples:
#1) "HH:SS"
Shows only minutes and seconds, perfect for round timers or cooldowns.
Result: 01:30
#2) "DD days, HH hours and MM minutes"
Creates a readable sentence. The system automatically handles the spaces and commas.
Result: 2 days, 04 hours and 15 minutes
#3) "MMm SSs FFFms"
Displays minutes, seconds, and milliseconds for pinpoint accuracy.
Result: 01m 22s 450ms
Validated examples using this method
On a running server
Use serhelp FormatDuration to inspect the reference generated by your installed SER version.