Description
Parses the input String for a time interval and returns the interval value in days.
Timing Precision Mode
This page describes functionality in nanosecond timing precision mode.
Click here to see the documentation for this object in millisecond timing precision mode.
Method Signature
TimeUtilities.ParseTimeInterval(
|
String timeInterval,
|
|
String format)
|
Arguments
timeInterval
|
|
Description:
|
The String to parse for a time interval.
|
format
|
|
Description:
|
Specifies the format of the input String. The format specification can include the time formats shown in the "Parsing Dates and Times" reference in the Help File, including days, hours, minutes, and seconds.
|
Return Value
Type:
|
timespan
|
Units:
|
day
|
Returns the time interval as a numeric value.
Syntax
myTimeSpan1 = TimeTools.ParseTimeInterval(myString1, myString2);
|
In this example, the string time interval is parsed and reported as a variable output.
Variable varTimeInterval;
varTimeInterval = TimeTools.ParseTimeInterval("12:00:00","hh:mm:ss"); // *** For Millisecond Mode Only ***
Or
varTimeInterval = TimeTools.ParseTimeInterval("12:00:00","hh:mm:ss").ToDays(); // *** For Nanosecond Mode Only ***
Report varTimeInterval;
|
Output:
varTimeInterval = 0.500000000;
Note: The returned Variable is in days by default.
|
See also
TimeUtilities Object
TimeUtilities.ParseTimeInterval
TimeSpans Guide
Parsing Dates and Times
|