SetDuration
- Last UpdatedNov 17, 2021
- 1 minute read
The SetDuration method sets the query period as a duration relative to the current time.
Syntax
[Result=] aaHistClientQuery.SetDuration(real duration);
[Result=] aaHistClientQuery.SetDuration(DateTime duration);
Parameters
duration
The duration from the current time.
Remarks
When using the ActiveX version of the control (for example, in the InTouch HMI software), the duration parameter can be either a number of days or a date/time string.
When using the .NET version of the control, the duration parameter must be a valid DateTime value.
In both cases, when you specify a date/time value, the duration is the difference between the specified date/time and the base date of December 30th, 1899, 12:00:00 AM.
For more information on the format for date/time values, see DateTime.
Example
In the following example, the time period is set to the past five minutes, relative to the current time.
#aaHistClientQuery1.SetDuration("00:05:00");
In the following example, the time period is set to the past 36 hours by specifying the number of days.
#aaHistClientQuery1.SetDuration(1.5);
In the following example, the time period is set to the past 36 hours by specifying a date/time value.
#aaHistClientQuery1.SetDuration("12/31/1899 12:00:00");