DATE DAY()

From Recital Documentation Wiki
Jump to: navigation, search

PURPOSE

Return the day of the month


SYNONYM

api_date_date()


SYNOPSIS

#include "dbapi.h"
 
int	DATE_DAY(date)
 
<input parameters>
unsigned long	date;		/* Recital date		*/
 
<output parameters>
none


DESCRIPTION

The DATE_DAY() function will return the day of the month from the specified date as an integer.


EXAMPLE

The following example converts today's date to integer value representing the day of the month.

#include "dbapi.h"
 
dbapi_date_day()
{	
    int		day;
    unsigned long	date;
 
    if (_parinfo(1) != API_DTYPE) {
       _retc("");
    }
 
    date = DATE_STOD(_pards(1) );
    day = DATE_DAY( date );
 
    if ( day == 1) {
       _retc( "First day of the Month");
    }
 
}


SEE ALSO

_parinfa(), _parinfo(), _pards(), _retds(), ISDATE(), DATE_AMPM(), DATE_CDOW(), DATE_CMONTH(), DATE_CTOD(), DATE_DOW(), DATE_DTOC(), DATE_DTOS(), DATE_MONTH(), DATE_STOD(), DATE_TIME(), DATE_YEAR()