x = convertTo(t, 'datenum')
x = convertTo(t, 'posixtime')
x = convertTo(t, 'juliandate')
x = convertTo(t, 'exceltime')
x = convertTo(t, 'yyyymmdd')
| Parameter | Description |
|---|---|
| inputs | A datetime array and a conversion kind. |
| Parameter | Description |
|---|---|
| output | A numeric array matching the requested representation. |
Convert datetime values to selected numeric representations.
convertTo centralizes the datetime conversions also available through datenum, posixtime, juliandate, exceltime, and yyyymmdd.
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, 5, 17)
convertTo(t, 'yyyymmdd')
| Version | Description |
|---|---|
| 2.0.0 | initial version |