« Back to Product

Documentation

Duration

Require: Symcon >= 8.0

Parameters

Information about the visual properties and meanings of the parameters can be found in the Object Presentation.

Name Type Parameter Description
PRESENTATION String Presentation GUID VARIABLE_PRESENTATION_DURATION
{08A6AF76-394E-D354-48D5-BFC690488E4E}
COUNTDOWN_TYPE Integer Display Type 0: Value in Variable, 1: Duration until Value in Variable, 2: Duration since Value in Variable
FORMAT Integer Format 0: Seconds only, 1: Minutes and Seconds, 2: Hours, Minutes, and Seconds, 3: Hours and Minutes
MILLISECONDS Boolean Show Milliseconds

Examples

// When registering a variable for PHP modules
// Formats the value of the variable as follows: 03:54
$this->RegisterVariableInteger('Countdown', 'Countdown', [
    'PRESENTATION' => VARIABLE_PRESENTATION_DURATION,
    'COUNTDOWN_TYPE' => 0 /* Value in Variable*/,
    'FORMAT' => 1 /* Minutes and Seconds */,
]);
// Formats the duration until the timestamp in the variable as follows: 03:10:08
$this->RegisterVariableInteger('Countdown', 'Countdown', [
    'PRESENTATION' => VARIABLE_PRESENTATION_DURATION,
    'COUNTDOWN_TYPE' => 1 /* Duration until Value in Variable*/,
    'FORMAT' => 2 /* Minutes and Seconds */,
]);

// For existing variables via script
// Formats the value of the variable as follows: 03:54
IPS_SetVariableCustomPresentation(12345, [
    'PRESENTATION' => VARIABLE_PRESENTATION_DURATION,
    'COUNTDOWN_TYPE' => 0 /* Value in Variable*/,
    'FORMAT' => 1 /* Minutes and Seconds */,
]);
// Formats the duration until the timestamp in the variable as follows: 03:10:08
IPS_SetVariableCustomPresentation(12345, [
    'PRESENTATION' => VARIABLE_PRESENTATION_DURATION,
    'COUNTDOWN_TYPE' => 1 /* Duration until Value in Variable*/,
    'FORMAT' => 2 /* Minutes and Seconds */,
]);
Any questions?