Description
Return month length under a supplied leap-year flag.
Civil calendar arithmetic needs explicit year numbering, leap rules and index origins. A weekday mask or Gregorian component operation does not identify a timezone, working calendar or historical calendar reform.
Return month length under a supplied leap-year flag.
When to use this tool
Use Date: Calendar Month Length With Leap Flag when checking the stated weekday or Gregorian calendar convention.
How to use the tool and how it works
- Enter month, leapYear. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Return month length under a supplied leap-year flag. Require month 1-12 and use the usual Gregorian month table, selecting 28 or 29 for February.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| month | Month | Required. Safe integer. |
| leapYear | Caller-supplied flag; not inferred from a year. | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.days | Days | Calculated result member: number. |
{
"input": {
"month": 2,
"leapYear": true
},
"output": {
"result": {
"days": 29
}
}
} Limitations and assumptions
- The flag is not derived from a year; historical calendars and actual date validity are not inferred.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use an appropriate full calendar library and authoritative local rules when business days, historical dates or real scheduling matter.
References
Similar or alternative tools
- Calendar Month Ordinal Serial Pair
Return a serial month coordinate.
- Calendar Month End Subtraction Clamp Loss
Clamp a source day to a supplied target-month length.