[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
Function dayofyear - calculate the day of the year
Syntax int dayofyear(struct ddate *d);
Prototype in datehk.h
Remarks dayofyear calculate the day of the year given a
date. The day of the year will range from 1
(January 1) to 365 (Dec 31, no leap year) or 366
(Dec 31, leap year.)
dayofyear does no error checking on passed
parameters.
Return value returns a number from 1 to 365 (no leap year) or
366 (leap year.)
See also dayofweek(), daysleft(), diffddate()
Example #include <datehk.h>
main()
{
struct ddate today;
/* set today to Feb 3, 1987 */
printf("%d/%d = day %d\n", today.dmon,
today.dday, dayofyear(&today));
}
Program output 2/3 = day 34
See Also:
dayofweek()
daysleft()
diffddate()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson