FUNCTION REFERENCE

day

Day of the month, week or year of each datetime.

Day of the month, week or year of each datetime.

Syntax

d = day(t)

Syntax

d = day(t, 'dayofweek')

Syntax

d = day(t, 'dayofyear')

Syntax

c = day(t, 'name')

The day of the week counts from 1 for Sunday. Names are English and come in

a cell array ('name' or 'shortname').

Example

d = day(datetime(2024, 3, 15))   % 15

Example

d = day(datetime(2024, 3, 15), 'dayofyear')   % 75

Differences from MATLAB: Names do not follow a locale.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.