d = day(t)
returns the day-of-month numbers for the datetime values in
t. The d output contains integer values
from 1 to 31, depending on the month and year.
Input date and time, specified as a datetime array.
dayType — Type of day values 'dayofmonth' (default) | 'dayofweek' | 'dayofyear' | 'name' | 'shortname'
Type of day values, specified as a value in the table.
Value of
dayType
Description
'dayofmonth'
Day-of-month number, from 1 to 28, 29, 30, or 31. The
range depends on the month.
'dayofweek'
Day-of-week number, from 1 to 7, where day 1 of the
week is Sunday.
'dayofyear'
Day-of-year number, from 1 to 365 or 366, depending
on the year.
'name'
Full day names, for example,
Sunday. For
NaT datetime values, the day name
is the empty character vector,
''.
'shortname'
Abbreviated day names, for example,
Sun. For NaT
datetime values, the day name is the empty character
vector, ''.
Note
day returns day names in the language specified by
the Locale option in the Datetime format section of the Preferences
panel. To change the default datetime locale, see Set Command Window Preferences.