xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET CENTURY

Sets the date format to include two or four digits.

Syntax

SET CENTURY on | OFF | ( <lOnOff> )

Arguments

on | OFF | ( <lOnOff> )
ON activates the display of century digits, and OFF deactivates them. Alternatively, a logical expression <lOnOff> can be specified in parentheses. .T. (true) represents ON, while .F. (false) stands for OFF.

Description

The SET CENTURY command enables or disables the display of century digits. By using the four digit notation for a year, dates of any century can be input. While SET CENTURY ON displays the four digit notation, SET CENTURY OFF will hide the century digits and will only display the year without century.

The century information is not removed from date values. Only the display and input of date values is affected. Dates from 01/01/0100 to 12/31/2999 are supported.

Info

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

Example

// This example shows the result of the SET CENTURY command:

   PROCEDURE Main
      SET CENTURY OFF
      ? Date()                  // Result: 12/06/05

      SET CENTURY ON
      ? Date()                  // Result: 12/06/2005
   RETURN

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