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. |
---|
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);
Dim ts0
ts0 = Pm.CreateTimeSpan("H", 0.5)
' or
Dim ts1
ts1 = Pm.CreateTimeSpan("M", 30)
' or
Dim ts2
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);
Dim tTimeSpan
tTimeSpan = 0.00756
Dim tMin
tMin = Pm.CreateTimeSpan("M", 1)
Dim nMin
nMin = Pm.Round(tTimeSpan / tMin, 1)