Utilities.StrToDate Method

Applies to TestComplete 14.0, last modified on January 23, 2019
This method is obsolete. See the Remarks section below.

Description

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

Declaration

Utilities.StrToDate(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. Str must consist of two or three numbers separated by the character defined by the DateSeparator property. The order for month, day, and year is determined by the ShortDateFormat property; possible combinations are: m/d/y, d/m/y, and y/m/d. If Str contains only two numbers, it is interpreted as a date (m/d or d/m) in the current year. If Str does not contain a valid date, StrToDate raises an exception.

Result Value

The integral part of the StrToDate method's return value is the number of days that have passed since 12/30/1899. The fractional part of this value is zero.

Remarks

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

See Also

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

Highlight search results