xHarbour Reference Documentation > Command Reference |
Specifies the date format for input and display.
SET DATE FORMAT [TO] <cDateFormat> or SET DATE [TO] AMERICAN | ansi | British | French | German | Italian | Japan | usa
If specified, <cDateFormat> determines the format (placement and number of digits) of the day, month and year. Position of day, month and year digits is defined by the number of occurrences of the letters d, m and y. Any other characters are displayed in the date values.
Keywords for SET DATE
Keyword | Date format |
---|---|
AMERICAN | mm/dd/yy |
ANSI | yy.mm.dd |
BRITISH | dd/mm/yy |
FRENCH | dd/mm/yy |
GERMAN | dd.mm.yy |
ITALIAN | dd-mm-yy |
JAPAN | yy/mm/dd |
USA | mm-dd-yy |
The SET DATE command specifies the format for the display and input of date values. It is a global setting valid for an entire xHarbour application.
See also: | CtoD(), Date(), DtoC(), DtoS(), Set(), SET CENTURY, SET EPOCH |
Category: | SET commands |
Source: | rtl\set.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// In this example the FORMAT clause directly specifies the date format PROCEDURE Main ? Set( _SET_DATEFORMAT ) // result: mm/dd/yy ? Date() // result: 12/21/05 SET DATE FORMAT TO "yy:mm:dd" ? Date() // result: 05:12:21 RETURN
http://www.xHarbour.com