|
AdapterBaseParseTimeTag Method
|
Parses a string formatted as an absolute or relative time tag.
Namespace: GSF.TimeSeries.AdaptersAssembly: GSF.TimeSeries (in GSF.TimeSeries.dll) Version: 2.4.249-beta
Syntaxpublic static DateTime ParseTimeTag(
string timetag
)
Public Shared Function ParseTimeTag (
timetag As String
) As DateTime
public:
static DateTime ParseTimeTag(
String^ timetag
)
static member ParseTimeTag :
timetag : string -> DateTime
GSF.TimeSeries.Adapters.AdapterBase.ParseTimeTag = function(timetag);
View SourceParameters
- timetag String
- String formatted as an absolute or relative time tag.
Return Value
DateTimeDateTime representing the parsed
timetag string formatted as an absolute or relative time tag.
ExceptionsException | Condition |
---|
ArgumentNullException | timetag parameter cannot be null or empty. |
FormatException | timetag 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 Format | Format Description |
---|
12-30-2000 23:59:59.033 | Absolute date and time. |
* | Evaluates to UtcNow. |
*-20s | Evaluates to 20 seconds before UtcNow. |
*-10m | Evaluates to 10 minutes before UtcNow. |
*-1h | Evaluates to 1 hour before UtcNow. |
*-1d | Evaluates to 1 day before UtcNow. |
*+2d | Evaluates to 2 days from UtcNow. |
See Also