libtime++: Date and time calculation

◆ timeutil_is_leap()

int timeutil_is_leap ( long int  year)

Definition at line 137 of file timeutil.c.

Referenced by main(), timeutil_date(), timeutil_doy(), and timeutil_norm().

139 {
140  int res1, res2, res3;
141 
142  if (year<70) { year = year + 2000; }
143  if (year<100) { year = year + 1900; }
144 
145  res1=(int)(year-(int)(year/4)*4);
146  res2=(int)(year-(int)(year/100)*100);
147  res3=(int)(year-(int)(year/400)*400);
148 
149  if (((res1==0) && (res2!=0)) || (res3==0))
150  {
151  return 1;
152  } else {
153  return 0;
154  }
155 } /* timeutil_is_leap */
Here is the caller graph for this function: