Promotic

Object PmDateObject

Description:
Auxiliary object used for date and time operations (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/time, or to transform it to a string that can be displayed in desired format, then it is handy to transform the date/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:
FormatCreates a text string containing date and time
GetValueReturns a value of the Date type
SetValueSets the PmDateObject object as a result of conversion of the data value of the VBScript language
SetDateTimeSets the PmDateObject object to desired year, month, day, ...
GetYearYear (integer)
GetMonthMonth (integer 1-12)
GetWeekdayday of the week (integer 0-6)
GetDayDay of the month (integer 1-31)
GetHourThe hour of the day (integer 0-23)
GetMinuteThe minute of the hour (integer 0-59)
GetSecondThe second of the minute (integer 0-59)
GetMillisecondThe millisecond of the second (integer 0-999)
SetYearSets the PmDateObject object to desired year (eventually month, day)
SetMonthSets the PmDateObject object to desired month (eventually day)
SetDaySets the PmDateObject object to desired day
SetHourSets the PmDateObject object to desired hour (eventually minute, second, millisecond)
SetMinuteSets the PmDateObject object to desired minute (eventually second, millisecond)
SetSecondSets the PmDateObject object to desired second (eventually millisecond)
SetMillisecondSets the PmDateObject object to desired millisecond

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

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