xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET DATE

Specifies the date format for input and display.

Syntax

SET DATE FORMAT [TO] <cDateFormat>

or

SET DATE [TO] AMERICAN |
                  ansi |
               British |
                French |
                German |
               Italian |
                 Japan |
                   usa

Arguments

TO <cDateFormat>
<cDateFormat> is a character expression specifying which type of date format will be used. The value of <cDateFormat> must be a string of up to 12 characters.

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.

If FORMAT is omitted, one of the following keywords can be used to specify the desired date format.

Keywords for SET DATE
KeywordDate format
AMERICANmm/dd/yy
ANSIyy.mm.dd
BRITISHdd/mm/yy
FRENCHdd/mm/yy
GERMANdd.mm.yy
ITALIANdd-mm-yy
JAPANyy/mm/dd
USAmm-dd-yy

Description

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.

Info

See also:CtoD(), Date(), DtoC(), DtoS(), Set(), SET CENTURY, SET EPOCH
Category: SET commands
Source:rtl\set.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe