Extract the number of the year from a date.
XSharp.RT (in XSharp.RT.dll) Version: 2.7
Syntax Request Example
dDate AS DATE
) AS DWORD
public static uint Year(
- Type: Date
The year of <dDate>, including the century digits, as a 4-digit number.
The value returned is not affected by SetDateFormat(), SetCentury(), SET DATE, or SET CENTURY. Specifying a NULL_DATE returns 0.
Year() is a date conversion function that converts a date value to a numeric year value.
If the century digits are not specified, the century is determined by the rules of SET EPOCH or SetEpoch().
Year() is a member of a group of functions that return components of a date value as numbers.
The group includes Day() and Month(), which return the day and month values as numbers.
These examples illustrate Year() using the system date:
3? YEAR(TODAY()) + 11
This example creates a function using Year() to format a date value in the form month, day, year:
3 RETURN CMONTH(dDate) + " " + ;
4 NTrim(DAY(dDate)) ;
5 + "," + STR(YEAR(dDate))