calendarDuration
Create calendar durations with month, day, and time components.
📝Syntax
c = calendarDuration(y, mo, d)
c = calendarDuration(y, mo, d, h, mi, s)
c = calendarDuration(x)
📥Input Arguments
Parameter Description
inputs Calendar years, months, days, and optional time components, or numeric arrays.
📤Output Arguments
Parameter Description
output A calendarDuration array storing months, days, seconds, and a display format.
📄Description

Create calendar durations with month, day, and time components.

Calendar durations preserve calendar semantics when added to datetimes. Month-based arithmetic clamps dates to month ends when needed.

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.
c = calendarDuration(0, 1, 3)
t = datetime(2024, 1, 31) + c
🔗See Also
datetimeduration
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub