Main Content

isdatetime

Determine if input is datetime array

Description

example

tf = isdatetime(t)returns logical1(true) iftis a datetime array. Otherwise, it returns logical0(false).

Examples

collapse all

Define an array.

A = [datetime('now');datetime('tomorrow');datetime(2016,1,15)]
A =3x1 datetime24-Aug-2020 20:05:35 25-Aug-2020 00:00:00 15-Jan-2016 00:00:00

Determine if the array is adatetimearray.

tf = isdatetime(A)
tf =logical1

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array.tcan be any data type.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2014b