Guardian Procedure Calls Reference Manual

DAYOFWEEK Procedure
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameter
Returned Value
Example
Summary
The DAYOFWEEK procedure takes a 32-bit Julian day number and returns the corresponding day
of the week.
Syntax for C Programmers
#include <cextdecs(DAYOFWEEK)>
short DAYOFWEEK ( __int32_t julian-day-num );
CEXTDECS (through the included file TNSINTH) defines 32-bit values as the typedef
__int32_t, which for TNS and TNS/R compiles is defined as long and for TNS/E compiles
is defined as int.
Syntax for TAL Programmers
day := DAYOFWEEK ( julian-day-num ); ! i
Parameter
julian-day-num
input
INT(32):value
contains the Julian day number for which the day of the week is desired.
Returned Value
INT
The code for the day of week, as follows: 0 = Sunday, 1 = Monday, ..., 6 = Saturday. If day is
-1, then the julian-day-num was negative.
Example
INT day
INT(32) JDN := 2435012D;
.
.
day := DAYOFWEEK ( JDN );
IF day < 0 THEN ...
DAYOFWEEK Procedure 251