Returns the date in January when the first Monday occurs.

View versions (1)

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 January

Parameters

year
can be any integer greater than -4799.
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

year
Result