Command SET DATE Foundation
Defines the date format for input and output.
Syntax
SET DATE FORMAT [TO] <cDateFormat>
SET DATE [TO] SYSTEM
| american | ansi | british | french
| german | italian | japan | usa
Scope
thread-local
Parameters
<cDateFormat>
<cDateFormat> is a character string containing the date format in a coded form. Positions of the digits for day, month and year are specified in the character string by the letters d, m and y. Characters other than the letters d, m and y are output without change.
When the option FORMAT is not specified, the date format must be selected using one of the key words listed in the following table:
Predefined date formats for use with SET DATE
Key word | Date format |
---|---|
AMERICAN | mm/dd/yy (American) |
ANSI | yy.mm.dd (ANSI) |
BRITISH | dd/mm/yy (British) |
FRENCH | dd/mm/yy (French) |
GERMAN | dd.mm.yy (German) |
ITALIAN | dd-mm-yy (Italian) |
JAPAN | yy/mm/dd (Japanese) |
SYSTEM | Date format from the operating system |
USA | mm-dd-yy (USA) |
Description
The command SET DATE defines the application-wide date format for the display of date values. The country specific default setting for the date format is predetermined in DBESYS.PRG when Database Engines are loaded. The call SET DATE TO SYSTEM selects the operating system's date format.
Examples
// In the example, the date format is defined using a
// character string and is reset to the system format
// at the end.
PROCEDURE Main
SET DATE FORMAT TO "dd.mm.yyyy"
SET CENTURY ON
? Date() // result: 06.12.1994
? DtoS( Date() ) // result: 19941206
SET DATE FORMAT TO "yyyymmdd"
? Date() // result: 19941206
SET DATE TO SYSTEM
RETURN
Feedback
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.