Functions

Month

Convert a date value to the number of the month

Syntax

Signature
int Month( int date );

Arguments

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

Return value

The month field, or 0 for a nonpositive date.

Description

Read the `MM` field from a `YYYYMMDD` date. Valid dates give a number from `1` through `12`, suitable for grouping records by month or indexing a table of month names. A nonpositive date gives `0`. Use `CMonth()` for the English name.

Example

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

#include <stdio.h>

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

   return 0;
}