Promotic

Object PmDateObject

Description:
Auxiliary object for working with date and time (especially in JavaScript panels).
The PROMOTIC system internally works with date and time in the form of PmDate - date and time in the PROMOTIC internal numeric form (real number). This PmDate format is used by majority of scripting methods of Pma objects. If it is necessary to execute more complex operation with the date and time, or to transform it to a string that can be displayed in desired format, then it is handy to transform the date and time from the PmDate form to an auxiliary PmDateObject object.

Creating of the object:
JavaScriptSelect and copy to clipboard

var d = Pm.CreatePmDateObject();   // Creates the object with current time
or:
JavaScriptSelect and copy to clipboard

var d = Pm.CreatePmDateObject(tDate);
Properties and methods:
Format()Creates a text string containing date and time
GetValue()Returns a value of the Date type
SetValue()Sets the PmDateObject object as a conversion result of the data value of the VBScript language
SetDateTime()Sets the PmDateObject object to desired year, month, day, ...
GetYear()Year (integer)
GetMonth()Month (integer 1-12)
GetWeekday()Day of the week (integer 0-6)
GetDay()Day of the month (integer 1-31)
GetHour()The hour of the day (integer 0-23)
GetMinute()The minute of the hour (integer 0-59)
GetSecond()The second of the minute (integer 0-59)
GetMillisecond()The millisecond of the second (integer 0-999)
GetDayOfYear()Day of year (integer 1-366)
GetWeekOfYear()Week of year (integer 1-53) according to ISO 8601
SetYear()Sets the PmDateObject object to desired year (eventually month, day)
SetMonth()Sets the PmDateObject object to desired month (eventually day)
SetDay()Sets the PmDateObject object to desired day
SetHour()Sets the PmDateObject object to desired hour (eventually minute, second, millisecond)
SetMinute()Sets the PmDateObject object to desired minute (eventually second, millisecond)
SetSecond()Sets the PmDateObject object to desired second (eventually millisecond)
SetMillisecond()Sets the PmDateObject object to desired millisecond

History:
Pm8.02.00: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.