The objects of this server class store duration as a date and time from January 1, 1970, 00:00:00.
Summarizes two SimpleDuration objects and returns the result.
Parameter(s):
Name | Type |
---|---|
duration | SimpleDuration |
Return:
Type | Description |
---|---|
SimpleDuration |
Example:
var simple_duration = new SimpleDuration("2 10:00:00"); var simple_duration_1 = new SimpleDuration("01:00:00"); var result = simple_duration.add(simple_duration_1); ss.info( result.getDisplayValue() ); |
Returns the value of the duration in a specified format.
Parameter(s):
Name | Type |
---|---|
format | String |
Return:
Type | Description |
---|---|
String | SimpleDuration object |
Example:
var simple_duration = new SimpleDuration("2 10:00:00"); ss.info( simple_duration.getByFormat('h:m') ); |
Returns the number of the days of the duration.
Return:
Type | Description |
---|---|
Integer | The number of the days. |
Example:
var simple_duration = new SimpleDuration("2 10:00:00"); ss.info( simple_duration.getDayPart() ); // 2 |
Returns the number of the days, hours and minutes of the duration.
Return:
Type | Description |
---|---|
String | The number of the days, hours and minutes |
Example:
var simple_duration = new SimpleDuration("10 10:00:00"); ss.info( simple_duration.getDisplayValue() ); //10 days 10 hours |
Returns the duration value in 'D H:i:s' format.
Return:
Type | Description |
---|---|
String | The duration value |
Example:
var simple_duration = new SimpleDuration("10 10:00:00"); ss.info( simple_duration.getDurationValue() ); //10 10:00:00 |