libtime++: Date and time calculation

◆ timeutil_doy()

long int timeutil_doy ( timeutil_Ttime  )

Definition at line 108 of file timeutil.c.

References timeutil_DaysInLeapYear, timeutil_DaysInYear, timeutil_is_leap(), and TU_CHECKERROR.

Referenced by timeutil_finish().

110 {
111  int *days;
112  long int doy;
113  int i;
114 
115  days=timeutil_DaysInYear;
116  if (timeutil_is_leap(td.year)==1) { days=timeutil_DaysInLeapYear; }
117 
118  doy=0;
119  i=1;
120  while (i<td.month) {
121  doy=doy+days[i];
122  i=i+1;
123  TU_CHECKERROR((i>13),"timeutil_doy","month value out of range")
124  }
125  doy=doy+td.day;
126  return doy;
127 } /* timeutil_doy */
static int timeutil_DaysInLeapYear[13]
Definition: timeutil.c:52
#define TU_CHECKERROR(EXPR, SUB, STR)
Definition: timeutil.c:39
int timeutil_is_leap(long int year)
Definition: timeutil.c:137
static int timeutil_DaysInYear[13]
Definition: timeutil.c:50
Here is the call graph for this function:
Here is the caller graph for this function: