Utilities.ShortDateFormat Property

Applies to TestComplete 14.70, last modified on April 22, 2021
This property is obsolete. See the Remarks section below.

Description

Use the Utilities.ShortDateFormat property to specify the format string that is used to convert a date value to a short string. For information about format specifiers, see Date and Time Format Specifiers.

Declaration

Utilities.ShortDateFormat

Read-Write Property String

Applies To

The property is applied to the following object:

Property Value

The format string that is used to convert a date value to a short string.

By default, ShortDateFormat holds the value specified by Regional Settings in the Windows Control Panel. To restore this value, call the GetFormatSettings method.

Remarks

Utilities.ShortDateFormat is obsolete and is supported for backward compatibility only. To get or set the short date format, use the aqEnvironment.GetLocaleInfo and aqEnvironment.SetLocaleInfo functions with LOCALE_SSHORTDATE as the second parameter.

JavaScript, JScript

var short_date_format = aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE);
Log.Message(short_date_format);

Python

short_date_format = aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE)
Log.Message(short_date_format)

VBScript

short_date_format = aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE)
Log.Message short_date_format

DelphiScript

short_date_format := aqEnvironment.GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE);
Log.Message(short_date_format);

C++Script, C#Script

var short_date_format = aqEnvironment["GetLocaleInfo"](LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE);
Log["Message"](short_date_format);

Or, if you want to convert date values using locale settings, use the methods of the aqDateTime object. They use locale-specific date formats when parsing values.

See Also

Working With Dates
Date and Time Format Specifiers
Today Method
Now Method
Time Method
DateTimeToStr Method
StrToDateTime Method
StrToDate Method
StrToTime Method

Highlight search results