Update cookies preferences
Promotic

CreateTimeSpan - method of the Pm object

Description:
Creates time span from defined part.
Syntax:
Double CreateTimeSpan(String sType, Double fValue)
Parameters:
sType(String) Specifies type of time span.
"d" - day
"H" - hour
"M" - minute
"S" - second
"T" - millisecond
fValue(Double) The value defining the size of the time span in the unit specified by the sType parameter. The value is a real number and can also be negative.
Note:
This method is functional also in Macro expression $.expr and in the onDraw event of the PmgCanvas object.
This method is also functional in Web panels.
See also:
- Pm.CreateDate (method)
- Pm.DateAdd (method)
- Pm.DateDiff (method)
Example1:
Creates a time span of 30 minutes in several ways.
JavaScriptVBScriptSelect and copy to clipboard

var ts0 = Pm.CreateTimeSpan("H", 0.5);
// or
var ts1 = Pm.CreateTimeSpan("M", 30);
// or
var ts2 = Pm.CreateTimeSpan("S", 1800);
Example2:
Detects how many minutes the given time-range contains.
JavaScriptVBScriptSelect and copy to clipboard

var tTimeSpan = 0.00756;
var tMin = Pm.CreateTimeSpan("M", 1);
var nMin = Pm.Round(tTimeSpan / tMin, 1);

History:
Pm9.00.26: Created
PROMOTIC 9.0.28 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
Navigation:
 
- Pm
 
- Abs
- Cos
- CreateTimeSpan
 
 
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
© MICROSYS, spol. s r.o.