months
Return whole calendar months between two dates.
📝Syntax
m = months(t1, t2)
📥Input Arguments
Parameter Description
inputs Two datetime or date-compatible inputs with matching sizes or scalar expansion.
📤Output Arguments
Parameter Description
output A double array of whole month counts.
📄Description

Return whole calendar months between two dates.

The result counts completed calendar months and adjusts when the second day-of-month is before the first.

Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.

💡Examples
Basic usage.
months(datetime(2024, 1, 31), datetime(2024, 3, 30))
🔗See Also
datetimeduration
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub