Difference between revisions of "Extensions.DateTime.FormatDuration"

From emotive
Jump to navigation Jump to search
Line 10: Line 10:
 
== Description ==
 
== Description ==
 
FormatDuration returns a specified duration in milliseconds as a string representation. Formatting will be made to the format of Date Term, with the difference that the milliseconds elapsed interpreted as a duration, not the date Analog.
 
FormatDuration returns a specified duration in milliseconds as a string representation. Formatting will be made to the format of Date Term, with the difference that the milliseconds elapsed interpreted as a duration, not the date Analog.
 +
 +
{{TermReturnValue| [[String]] | A formatted time.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| Duration | [[String]] | [[Variable]] | - | [0..1] | A formatted time.}}
+
{{TableRowPropertie1| Timestamp | [[Integer]] | [[Term]] | - | [0..1] | This property represents a duration in milliseconds to a string that is formatted according to the specified rules.}}
{{TableRowPropertie2| Timestamp | [[Integer]] | [[Term]] | - | [0..1] | This property represents a duration in milliseconds to a string that is formatted according to the specified rules.}}
+
{{TableRowPropertie2| Pattern | [[String]] | [[Term]] | - | [0..1] | User-specified format for displaying the time.}}
{{TableRowPropertie1 | Pattern | [[String]] | [[Term]] | - | [0..1] | User-specified format for displaying the time.}}
 
 
|}
 
|}
  

Revision as of 04:44, 17 July 2014

Classification

Name FormatDuration
Short Description Give a duration in milliseconds from a time stamp.
Class Term
Extension OTX DateTime Extension
Group -
Exceptions OutOfBoundsException
Checker Rules -
Standard Compliant Yes

Pseudo-Code Syntax

String duration = FormatDuration(timeStamp, <<pattern>>);

Description

FormatDuration returns a specified duration in milliseconds as a string representation. Formatting will be made to the format of Date Term, with the difference that the milliseconds elapsed interpreted as a duration, not the date Analog.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
String A formatted time.

Properties

Name Data Type Class Default Cardinality Description
Timestamp Integer Term - [0..1] This property represents a duration in milliseconds to a string that is formatted according to the specified rules.
Pattern String Term - [0..1] User-specified format for displaying the time.

Examples

A duration of 203443 milliseconds ( 3 minutes 23 seconds and 443 milliseconds ), a pattern such as " 'It takes' m 'minutes and' s '.seconds' "generates the following formatted output: "It takes 3 minutes and 23 seconds."

If there is no pattern specified, the output is after the fashion of ISO 8601 ( 'P'yyyy-MM-dd'T'HH: mm: ss' . 'SSS ) " P0000-00-00T00: 03:23.443 ", where " P " designator for the duration and " T " is the designator for time.

See also

GetTimeStamp
FormatDate