Lasso Soft Inc. > Home

[ duration->format ]

Method

[Duration->Format] formats the duration as a string. The default format is HH:MM:SS format where the hour part may be longer than two digits if the duration is longer than 99 hours. An optional -ISO parameter formats the duration in ISO format as PYxMxDxTHxMxDx with any zero elements omitted. An optional -Combined formats the duration combined format as PYYYY-MM-DDTHH:MM:SS.

  • Syntax
Duration Object->Format
Duration Object->Format(-iso=Boolean)
Duration Object->Format(-combined=Boolean)
Examples
  • Beginner

To format a duration object as a string:

Use the [Duration->Format] method. The following example uses a single duration object, then displays it in its three formats.

Code

duration('12:34:56')->format
duration('12:34:56')->format(-iso=true)
duration('12:34:56')->format(-combined=true)

Result

12:34:56
PT12H34M56S
P0Y0M0DT12H34M56S
Resources
  • Articles

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft