Promotic
WikipediaLinkedInYoutubeTwitterFacebook

How to work with time in the PROMOTIC system.

In the PROMOTIC system, the Date data type is used very often. In panels designed with the JavaScript language, the auxiliary object PmDateObject is used.
 
PmDate - date and time in the PROMOTIC internal numeric form - (Date data type) is used internally in the PROMOTIC system, and also in the scripting interface of the PROMOTIC objects. It is a simple numeric value and therefore it can be easily used in scripts (read, write, save, transfer to other scripts, etc.). However, if it is necessary to execute more complicated operations with the date/time (time shifts, formatting for displaying, etc.), it is handy to create an auxiliary object PmDateObject with the PmDate value.
 

VBScript

In order to work with date and time, the VBScript uses the Date data type.

VBScript date and time functions can be used to work with time.

 
Date date and time can be created by several ways Now, Date, Time, or Notes for Date data type:, ...

JavaScript

In this language time is managed by the auxiliary PROMOTIC object PmDateObject. This object is optimized for usage in the PROMOTIC object and has the following interface PmDateObject.

The JavaScript language has its own Date() object, but it is not recommended to use in the PROMOTIC system.

 
The PmDateObject object can be can be created by the Pm.CreatePmDateObject method.

Some other PROMOTIC methods using date and time

Pm.CreateDate - Getting date and time or getting time interval
Pm.CreatePmDateObject - Creating the auxiliary object PmDateObject for working with date and time.
Pm.FormatDate - Getting the string from a date
Pm.GetDateOf - Derive dates from defined base date
Pm.IsDaylight - Test of the "daylight-saving time"
Pm.ScanDate - Getting date and time from text value
Pm.Time - System time
PmTrend.GetTime - Returns requested time
PmTrend.CreateFilter - Create the value of the filter range for next methods
PmTrend.RunTime - Save the current values with the specified time
PmTrend.GetValueByTime - Getting the value (more values) of a variable (more variables) by the specified time.
PmTrend.SetValueByTime - Writing the value (more values) or a variable (more variables) by the specified time.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice