ymd
Split datetime values into year, month, and day components.
📝Syntax
[y, m, d] = ymd(t)
📥Input Arguments
Parameter Description
inputs datetime values, serial date numbers, or date-compatible input.
📤Output Arguments
Parameter Description
output Three double arrays containing year, month, and day values.
📄Description

Split datetime values into year, month, and day components.

ymd is a convenience wrapper around date vector extraction for calendar date components.

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.
[y, m, d] = ymd(datetime(2024, 5, 17))
🔗See Also
datetimeduration
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub