Difference between revisions of "Extensions.DateTime.FormatDuration"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
== OTL Syntax == | == OTL Syntax == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | + | /// Local Declarations | |
+ | String CurrentVariable; | ||
+ | /// Flow | ||
+ | CurrentVariable = FormatDuration(IntegerTerm, StringTerm); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 24: | Line 27: | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
+ | /// Local Declarations | ||
+ | |||
String CurrentTime; | String CurrentTime; | ||
+ | |||
+ | /// Flow | ||
CurrentTime = DateTime.FormatDuration(1000, "S,s"); | CurrentTime = DateTime.FormatDuration(1000, "S,s"); |
Revision as of 02:38, 24 October 2018
Contents
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 |
OTL Syntax
/// Local Declarations
String CurrentVariable;
/// Flow
CurrentVariable = FormatDuration(IntegerTerm, StringTerm);
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.
If the duration value is negative, the OutOfBoundsException exception will be thrown.
Return Value
The Term returns the value, see table below.
![]()
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 |
duration | Integer | Term | - | [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. |
OTL Examples
/// Local Declarations
String CurrentTime;
/// Flow
CurrentTime = DateTime.FormatDuration(1000, "S,s");