Functions

DoW

Convert a date value to a numeric day of the week

Syntax

Signature
int DoW( int date );

Arguments

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

Return value

A value from 1 (Sunday) to 7 (Saturday), or 0 for a nonpositive date.

Description

Use the weekday number for calculations that depend on the day of the week. The sequence starts at `1` for Sunday and ends at `7` for Saturday. An empty date gives `0`. Use `CDoW()` when you need an English weekday name.

Example

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

#include <stdio.h>

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

   return 0;
}