GetTimeByTime - method of the tvPoints object
Description:
Search for time of data point (time array) according to specified parameters.
Syntax:
Variant GetTimeByTime(Variant vTime, Variant nStyle, Long nCount)
Parameters:
vTime | (Variant) Time whereby the data points have to be searched.
The time is expected according to setting the PmgTrendViewer.TimeSetType property, i.e. "local time", "standard time" or "daylight-saving time". |
nStyle | (Variant) Type of searching the data point.
0 - the point whose time is less then or equal vTime
1 - the point whose time is greater or equal vTime
2 - the point that is the closest to the vTime time |
nCount | (Long) The number of the time values of the found data points.
1 - one time of the first point
>1 - nCount time values in the array (not implemented in the JavaScript language) |
---|
Return value:
The method returns the time (the time array) of the found point.
If no point has been found then the method returns:
null for
JavaScript or
Empty for
VBScript (it can be tested by the
Pm.IsValid method).
Example1:
Time has to be entered as the "local time" (the "standard time" in the standard season and the "daylight-saving time" in the daylight-saving season).:
JavaScriptVBScriptSelect and copy to clipboard
var t, vTime;
var oTView = pMe;
var oPoints = oTView.Trends("t1").Points;
oTView.TimeSetType = 1;
vTime = "...";
// is "local time"
t = oPoints.GetTimeByTime(vTime, 0, 1);
Dim t, vTime, oTView, oPoints
Set oTView = pMe
Set oPoints = oTView.Trends("t1").Points
oTView.TimeSetType = 1
vTime = "..."
' is "local time"
t = oPoints.GetTimeByTime(vTime, 0, 1)
Example2:
Time has to be entered as the "standard time" even in the daylight-saving season:
JavaScriptVBScriptSelect and copy to clipboard
oTView.TimeSetType = 2;
vTime = "...";
// is "standard time"
t = oPoints.GetTimeByTime(vTime, 0, 1);
oTView.TimeSetType = 2
vTime = "..."
' is "standard time"
t = oPoints.GetTimeByTime(vTime, 0, 1)