NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DateTime.DaysInMonth

Returns the number of days in a month determined by the specified year and month.

[Visual Basic]
Public Shared Function DaysInMonth( _
   ByVal year As Integer, _
   ByVal month As Integer _
) As Integer
[C#]
public static int DaysInMonth(
   int year,
   int month
);
[C++]
public: static int DaysInMonth(
   int year,
   int month
);
[JScript]
public static function DaysInMonth(
   year : int,
   month : int
) : int;

Parameters

year
The year.
month
The month (1..12).

Return Value

The value is the number of days in the month specified by the year and month arguments.

Exceptions

Exception Type Condition
ArgumentException If the month is less than 1 or greater than 12.

Remarks

The DaysInMonth method is used to retrieve the number of days in a month where the month and year are specified.

The month value is an integer one through twelve (1 through 12). For example: for the month of February (month equals 2), the returned value is 28 or 29, depending upon whether the year is a leap year.

See Also

DateTime Structure | DateTime Members | System Namespace | Int32 | Calendar