[y,m,d]
= ymd(t)
returns the year, month, and day numbers of the datetime values in
t as separate numeric arrays. The y,
m, and d outputs are the same size as
t, and contain integer values.
The ymd function is equivalent to calling the
year, month, and day
functions on the same datetime array.
y — ISO year numbers scalar | vector | matrix | multidimensional array
ISO year numbers, returned as a scalar, vector, matrix, or
multidimensional array of integer values. ISO year numbers include a year
zero and represent years BCE using negative values. y is
of type double and is the same size as
t.
Month numbers, returned as a scalar, vector, matrix, or multidimensional
array of integer values from 1 to 12. m is of type
double and is the same size as
t.
d — Day of month numbers scalar | vector | matrix | multidimensional array
Day of month numbers, returned as a scalar, vector, matrix, or
multidimensional array of integer values from 1 to 28, 29, 30, or 31,
depending on the month and year. d is of type
double and is the same size as
t.
Extended Capabilities
Tall Arrays Calculate with arrays that have more rows than fit in memory.
The
ymd function fully supports tall arrays. For more information,
see Tall Arrays.
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
Thread-Based Environment Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.