Click or drag to resize
OSIsoft, LLC

AFTimeRange Constructor (String, String)

Creates a new AFTimeRange object with the specified string representations of start and end times.

Namespace:  OSIsoft.AF.Time
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.6.195
Syntax
public AFTimeRange(
	string startTime,
	string endTime
)

Parameters

startTime
Type: SystemString

The starting time of the time range represented by this object, specified in a string format. Strings are interpreted as local time unless it also contains a time zone indicator, such as a trailing "Z" or "GMT". PI Time formats ("*", "T", "*-1h", "+3d", etc.) are also supported.

Relative parameter rules:

  • If the startTime starts with "+" or "-" (without a "*" specified), then the start time will be relative to the end time.
  • If the endTime starts with "+" or "-" (without a "*" specified) and the startTime does not start with "+" or "-", then the end time will be relative to the start time.
  • If neither of these conditions are true, then the times are not relative to each other.

endTime
Type: SystemString

The ending time of the time range represented by this object, specified in a string format. Strings are interpreted as local time unless it also contains a time zone indicator, such as a trailing "Z" or "GMT". PI Time formats ("*", "T", "*-1h", "+3d", etc.) are also supported.

Relative parameter rules:

  • If the startTime starts with "+" or "-" (without a "*" specified), then the start time will be relative to the end time.
  • If the endTime starts with "+" or "-" (without a "*" specified) and the startTime does not start with "+" or "-", then the end time will be relative to the start time.
  • If neither of these conditions are true, then the times are not relative to each other.

Remarks
An AFTimeRange represents a period of time between the StartTime and EndTime. This constructor will use the CurrentCulture when parsing the startTime and endTime parameters. Use the constructor that accepts an IFormatProvider to specify a specific culture or for parsing.
Version Information

AFSDK

Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6, 2.5, 2.4
See Also
Enabling Operational Intelligence