TimeSelector.SetStartAndEndTimes
- Last UpdatedFeb 25, 2021
- 1 minute read
The TimeSelector.SetStartAndEndTimes method sets the start and end times for the query.
You must specify one of the following parameter combinations:
-
Start time and end time. Set the Duration parameter to Custom (0).
-
Start time and duration. Set the EndTime parameter to "".
-
End time and duration. Set the StartTime parameter to "".
-
Start time, duration, and end time. The Trend Client shows an error message if start time plus duration is not equal to end time.
Syntax
Trend01.SetStartAndEndTimes(DateTime StartTime, DateTime EndTime, integer Duration);
Parameters
StartTime
The start time for the query. Only considered if the duration is set to Custom (0) by the Duration parameter. For other durations, the start time is calculated automatically based on the end time and duration.
EndTime
The end time for the query. Only considered if the duration is set to Custom or an option from 17 to 32 (OneMinute to ThreeMonths) by the Duration parameter. Otherwise, the end time is set based on the duration.
Duration
Duration enum. For more information on possible duration values, see "TimeSelector.TimeDuration".
Example
Trend01.TimeSelector.SetStartAndEndTimes("08/31/2008 15:33:43","09/01/2009 15:33:43",0);