Returns the number of days in the year of a Gregorian calendars. <span align="right" style="background-color:9999FF"><strong>Open Office: DAYSINYEAR</strong></span>

View versions (1)

Interface

#include <codecogs/units/date/daysinyear.h>

using namespace Units::Date;

Returns the number of days in the year of a Gregorian calendar. Through the use of isLeapYear, this function is simply:

365 + isLeapYear(Year);

Example 1

#include <stdio.h>
#include <codecogs/units/date/date.h>
#include <codecogs/units/date/daysinyear.h>

using namespace Units::Date;

int main()
{
  for(int i=2000;i<=2004;i++)
    printf("\n Year %d has %d days",i , daysInYear(i));
  return 0;
}

Parameters

year
can be any integer greater than 4800 BC (see isLeapYear).
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

year
Result