CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

UnitsDate

days In Month

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 1.17
sub units 1.17
add a commercial licence to your cart
0
viewed 4616 times and licensed 75 times

Returns the number of days in the month of a Gregorian calendars. Open Office: DAYSINMONTH

Further Info Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

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

using namespace Units::Date;

int daysInMonth (int year, int month)
Returns the number of days in the month of a Gregorian calendars. Open Office: DAYSINMONTH
ExcelInteger cc_daysInMonth (Integer year, Integer month)
This function is available as a Microsoft Excel add-in.

Function Documentation

Days In Month Calculator
  
Add calculator to website or email
 
intdaysInMonthintyear
intmonth )
Returns the number of days in the months of a Gregorian calendar for the month of year. The year is used to apply adjustments for leap years.

Each month has a fixed number of days, except in a leap year, when February gains an extra day. Although we traditionally treat the 29th February as the leap day, a left over remnant of the Roman calendar means that the theoretical leap day occurs on the 24th February - many celebrations occur on this day for this reason.

The number of days in each month of the Gregorian / Julian calendar are:
January31
February28/29
March31
April30
May31
June30
July31
August31
September30
October31
November30
December31
Example 1:
To output the number of days in each month of 1974
#include <stdio.h>
#include <codecogs/units/date/daysinmonth.h>

int main() { for(int i=1;i<=12;i++) printf("\n Month %d has %d days",i , Units::Date::daysInMonth(2004,i)); return 0; }
Parameters:
yearcan be any integer greater than 4800 BC (see isLeapYear).
monthcan be any integer between 1 and 12 (inclusive).
Authors:
Will Bateman (Sep 2004)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-13 14:39:09

Valid CSS!   Valid XHTML 1.0 Transitional