Click or drag to resize

AdapterBaseParseTimeTag Method

Parses a string formatted as an absolute or relative time tag.

Namespace: GSF.TimeSeries.Adapters
Assembly: GSF.TimeSeries (in GSF.TimeSeries.dll) Version: 2.4.181-beta
Syntax
public static DateTime ParseTimeTag(
	string timetag
)
View Source

Parameters

timetag  String
String formatted as an absolute or relative time tag.

Return Value

DateTime
DateTime representing the parsed timetag string formatted as an absolute or relative time tag.
Exceptions
ExceptionCondition
ArgumentNullExceptiontimetag parameter cannot be null or empty.
FormatExceptiontimetag does not contain a valid string representation of a date and time.
Remarks

Relative times are parsed based on an offset to current time (UTC) specified by "*".

The timetag parameter can be specified in one of the following formats:
Time FormatFormat Description
12-30-2000 23:59:59.033Absolute date and time.
*Evaluates to UtcNow.
*-20sEvaluates to 20 seconds before UtcNow.
*-10mEvaluates to 10 minutes before UtcNow.
*-1hEvaluates to 1 hour before UtcNow.
*-1dEvaluates to 1 day before UtcNow.
*+2dEvaluates to 2 days from UtcNow.

See Also