The number of days in a given month of a given year.

Days = SRP_Date("DaysInMonth", Month, Year = 0)

Returns

The number of days in the given month and year.

Parameters

ParameterDescription
MonthA month identifier, 1 - 12. (REQUIRED)
YearThe year, or 0 for a non-leap year. (OPTIONAL)

Remarks

The "DaysInMonth" service retrieves the number of days in a given month and year. The Month parameter must be an integer between 1 and 12, otherwise, "" is returned. The Year is optional. If omitted or set to 0, then a non-leap year is assumed. If Year is set to something non-zero, then leap years are taken into account.

Examples

// Get the number of days in a typical February
Days = SRP_Date("DaysInMonth", 2)

// Get the number of days in February this year
Days = SRP_Date("DaysInMonth", 2, SRP_Date("Year", Date()))

// Get the number of days in February in a known leap year
Days = SRP_Date("DaysInMonth", 2, 2020)
  • No labels