FUNCTION
daysInYear
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>
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).
Interactive Calculator
year
Result
Computing…
Set a range above first to export a graph.
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.