d = day(t)
d = day(t, 'dayofmonth')
d = day(t, 'dayofyear')
name = day(t, 'name')
abbr = day(t, 'shortname')
| Parameter | Description |
|---|---|
| inputs | datetime values, serial date numbers, or date-compatible input, plus optional day selector. |
| Parameter | Description |
|---|---|
| output | A double day array or string day-name array. |
Extract day information from date and time values.
The default is day of month. dayofyear counts from January 1. name and shortname return weekday names.
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
t = datetime(2024, 2, 29)
day(t)
day(t, 'dayofyear')
| Version | Description |
|---|---|
| 2.0.0 | initial version |