Partager via


DateTime.DaysInMonth Method

Returns the number of days in a specified month of a specified year.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

public static int DaysInMonth (
         int year,
         int month
)

Parameters

  • year
    A specific year, expressed as a number from 1 through 9999.
  • month
    A specific month, expressed as a number from 1 through 12.

Return Value

The number of days in the specified month (from 28 through 31).

Remarks

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

DateTime Structure
DateTime Members
System Namespace