Promotic

TimeSerial - function of language VBScript

Description:
Returns a value of the Date type containing the time for a specific hour, minute, and second.
In the PROMOTIC system it is better to use the Pm.CreateDate method.
Syntax:
Date TimeSerial(Integer hour, Integer minute, Integer second)
Parameters:
hour(Integer) number in the range from 0 (12:00 A.M.) to 23 (11:00 P.M.)
minute(Integer) number - represents a minute
second(Integer) number - represents a second
Note:
To specify a time (e.g. 11:59:59), the range of numbers for each TimeSerial parameter should be in the accepted range for the unit. It means 0–23 for hours and 0–59 for minutes and seconds. However, you can also specify relative times for each parameter using any numeric expression that represents some number of hours, minutes or seconds before or after a certain time.

If any parameter exceeds the accepted range for that parameter, then it increments to the next larger unit as appropriate. For example, if you specify 75 minutes, it is evaluated as one hour and 15 minutes. However, if any single parameter is outside the range -32,768 to 32,767, or if the time specified by the three parameters, either directly or by expression, causes the date to fall outside the acceptable range of dates, then an error occurs.
The Pm.CreateDate method allows to set the value of date and time together including milliseconds.
Example:
The example uses expressions instead of absolute time numbers. The function returns a time for 15 minutes before (-15) six hours before noon (12-6), i.e. 5:45:00 A.M.
VBScriptSelect and copy to clipboard

Dim tTime
tTime = TimeSerial(12 - 6, -15, 0)
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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