m = month(t)
name = month(t, 'name')
abbr = month(t, 'shortname')
| Parameter | Description |
|---|---|
| inputs | datetime values, serial date numbers, or date-compatible input, plus optional name output selector. |
| Parameter | Description |
|---|---|
| output | A double array of month numbers, or a string array of month names. |
Extract month numbers or names from date and time values.
Use name for full English month names and shortname for abbreviated names.
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
month(datetime(2024, 5, 17))
month(datetime(2024, 5, 17), 'name')
| Version | Description |
|---|---|
| 2.0.0 | initial version |