Formatted Timespan (Function) — SkBee
Addon: SkBee · Category: Function · Since: 3.19.0
Syntax
formattedTimespan(timespan: timespan, format: string) :: stringDescription
Formats a Timespan into a string using a format. **Available Formats**: - `y` = years - `M` = months - `d` = days - `H` = hours - `m` = minutes - `s` = seconds - `S` = milliseconds - `'text'` = arbitrary text content **Note**: It's not currently possible to include a single-quote in a format. Token values are printed using decimal digits. A token character can be repeated to ensure that the field occupies a certain minimum size. Values will be left-padded with 0 unless padding is disabled in the method invocation.
Examples
set {_formatted} to formattedTimespan(1 hour, "HH:mm:ss")
set {_formatted} to formattedTimespan(1 hour, "HH:mm:ss.SSS")
set {_formatted} to formattedTimespan({_ts}, "H 'hours and' m 'minutes'")