xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Year()

Extracts the numeric year from a Date value

Syntax

Year( <dDate> ) --> nYear

Arguments

<dDate>
This is a Date value to extract the year from.

Return

The function returns a four digit year as a numeric value, or zero when <dDate> is an empty date.

Description

Year() extracts the year from a date value as a four digit number, without recognizing the settings SET DATE or SET CENTURY. Other parts of a date value can be extracted using function Day() or Month().

Info

See also:CDoW(), CMonth(), CtoD(), Day(), DtoC(), Hour(), Minute(), Month(), Secs()
Category: Conversion functions , Date and time
Source:rtl\dateshb.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example shows results of the function Year()

   PROCEDURE Main

     ? Date()                          // result: 05/10/06
     ? Year( Date() )                  // result: 2006
     ? Year( Date() ) - 19             // result: 1987

   RETURN

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