Utilities.StrToDateTime Method

Applies to TestComplete 12.60, last modified on September 17, 2018
This method is obsolete. See the Remarks section below.

Description

The Utilities.StrToDateTime method converts the string specified by the Str parameter to a Variant value that encodes date and time.

Declaration

Utilities.StrToDateTime(Str)

Str [in]    Required    String    
Result Variant

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Str

Specifies the string to be converted to a value storing date and time. The Str parameter must use the current locale’s date/time format. In the US, this is commonly MM/DD/YY HH:MM:SS format. Specifying AM or PM as part of the time is optional, as are the seconds. Use 24-hour time (7:45 PM is entered as 19:45, for example) if AM or PM is not specified. If Str does not contain a valid date and time, StrToDateTime raises an exception.

Result Value

The integral part of the StrToDateTime method’s return value is the number of days that have passed since 12/30/1899. The fractional part of this value is fraction of a 24-hour day that has elapsed.

Remarks

This method is obsolete. It is supported for backward compatibility only. To convert a string to a date and time value, use the aqConvert.StrToDateTime method.

See Also

Working With Dates
Working With Time
aqConvert.StrToDateTime Method
aqConvert.StrToDate Method
aqConvert.DateTimeToFormatStr Method
aqConvert.DateTimeToStr Method

Highlight search results