Functions

Year

Convert a date value to the year as a numeric value

Syntax

Signature
int Year( int date );

Arguments

date Date encoded as the integer YYYYMMDD, for example 20261201.

Return value

The year field, or 0 for a nonpositive date.

Description

Read the year field of a `YYYYMMDD` date. Use it with `Month()` and `Day()` to format the components separately or group dates for a report. A nonpositive date gives `0`.

Example

year.c
#include "xdev-wtui.h"

#include <stdio.h>

int main( void )
{
   printf( "%d\n", Year( 19901010 ) );

   return 0;
}