Automate

Automate

Make your phone or tablet smarter with automation

Get it on Google Play

durationFormat

text durationFormat(duration, pattern, language)

Returns the duration formatted according to pattern, language is currently ignored.

Pattern symbols with special meaning:

SymbolComponent
dDays
HHours
mMinutes
sSeconds
SMilliseconds
'Avoid interpretation
''Single quote

Examples

PatternResult
H:mm:ss.SSS1:34:12.678
H'h'm'm's's'1h34m12s
H 'hours', m 'minutes', s 'seconds'1 hours, 34 minutes, 12 seconds

Parameters

  1. duration — duration in seconds.
  2. pattern — optional formatting pattern, default is H'h'm'm's's'.
  3. language — optional language code, currently ignored.

Returns

  • the formatted duration.
Note! This documentation is also accessible within the app from Help & feedback menu.