« Back to Product

Documentation

Date/Time

Require: Symcon >= 8.0

Parameter

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

Name Type Parameter Description
PRESENTATION String GUID of the Presentation VARIABLE_PRESENTATION_DATE_TIME
{497C4845-27FA-6E4F-AE37-5D951D3BDBF9}
DATE Integer Date Display 0: None, 1: Year, Month, and Day, 2: Month and Day, 3: Year and Day
MONTH_TEXT Boolean Format Month as false: Number, true: Text
DAY_OF_THE_WEEK Boolean Show Day of the Week
TIME Integer Time Display 0: None, 1: Hours and Minutes, 2: Hours, Minutes, and Seconds

Templates

// Registers a variable with a date template.
$this->RegisterVariableFloat('Date', 'Date', [
    'PRESENTATION' => VARIABLE_PRESENTATION_DATE_TIME,
    'TEMPLATE' => VARIABLE_TEMPLATE_DATE,
]);
Name Constant GUID
Date VARIABLE_TEMPLATE_DATE {B4C70F3E-6613-DA1A-7279-5DEE8DEB1B24}
Time VARIABLE_TEMPLATE_TIME {362DA268-56A2-E771-5E53-17E38B5D82E6}
Date/Time VARIABLE_TEMPLATE_DATE_TIME {BB0E9933-0403-BD3A-D1C9-255646934B00}

Examples

// When registering a variable for PHP modules
// Only icons are displayed. One option is highlighted in color.
$this->RegisterVariableInteger('Alarm', 'Alarm Time', [
    'PRESENTATION' => VARIABLE_PRESENTATION_DATE_TIME,
    'DATE' => 0 /* None */,
    'TIME' => 2 /* Hours, Minutes, and Seconds */,
]);
// Shows only the time: 05:09:37
$this->RegisterVariableInteger('Alarm', 'Alarm Time', [
    'PRESENTATION' => VARIABLE_PRESENTATION_DATE_TIME,
    'DATE' => 0 /* None */,
    'TIME' => 2 /* Hours, Minutes, and Seconds */,
]);

// For existing variables via script
// Displays a date as follows: Sun, May 3, 2026 05:09
IPS_SetVariableCustomPresentation(12345, [
    'PRESENTATION' => VARIABLE_PRESENTATION_DATE_TIME,
    'DATE' => 1 /* Year, Month, and Day */,
    'DAY_OF_THE_WEEK' => true,
    'TIME' => 1 /* Hours and Minutes */,
]);
// Shows only the time: 05:09:37
IPS_SetVariableCustomPresentation(12345, [
    'PRESENTATION' => VARIABLE_PRESENTATION_DATE_TIME,
    'DATE' => 0 /* None */,
    'TIME' => 2 /* Hours, Minutes, and Seconds */,
]);
Any questions?