FUNCTION
firstMonday
Returns the date in January when the first Monday occurs.
Interface
#include <codecogs/units/date/firstmonday.h>
using namespace Units::Date;
Computes the number of days from the start of the year to the first Monday of the year (inclusive). This is the same as the date in January with the first Monday.
Example 1
#include <stdio.h>
#include <codecogs/units/date/firstMonday.h>
using namespace Units::Date;
int main()
{
for(int i=2000;i<2004;i++)
printf("\n The first Monday in year %d is on the %d January", i, firstMonday(i));
return 0;
}Output:
The first Monday in year 2000 is on the 3 January
The first Monday in year 2001 is on the 1 January
The first Monday in year 2002 is on the 7 January
The first Monday in year 2003 is on the 6 JanuaryParameters
year
can be any integer greater than -4799.
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.