ParseTime(String, String) Method
Returns an AFTime object for a given time evaluated with respect to a specified reference time.
Definition
Namespace: GHost.GSharp.Analytics.AF
Assembly: GHost.GSharp.Analytics.AF (in GHost.GSharp.Analytics.AF.dll) Version: 1.2.0.0 (1.2.44.3)
C#
public static AFTime ParseTime(
string time,
string refTime
)
VB
Public Shared Function ParseTime (
time As String,
refTime As String
) As AFTime
Parameters
- String
- A timestamp string (in time/date, absolute or relative PI time formats).
- String
- A string specifying a reference time. If the parameter time is in the absolute or relative PI time format,it is evaluated with respect to the reference time.
Return Value
AFTime
AFTime object corresponding to the specified time.
Example
C#
AFTime result = new AFTime();
result = ParseTime("t", "*-2d"); //The specified absolute PI time "t" is evaluated with respect to the reference time "*-2d".
result = ParseTime("*-1h", "*-2d"); //The specified relative PI time "*-1h" is evaluated with respect to the reference time "*-2d".
Exceptions
| FormatException |
See Also
Reference
FunctionLibrary Class
ParseTime Overload
GHost.GSharp.Analytics.AF Namespace