This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Determine if input is datetime array


tf = isdatetime(t)



tf = isdatetime(t) returns logical 1 (true) if t is a datetime array. Otherwise, it returns logical 0 (false).


collapse all

Define an array.

A = [datetime('now');datetime('tomorrow');datetime(2016,1,15)]
A = 3x1 datetime array
   27-Aug-2018 13:31:15
   28-Aug-2018 00:00:00
   15-Jan-2016 00:00:00

Determine if the array is a datetime array.

tf = isdatetime(A)
tf = logical

Input Arguments

collapse all

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

Extended Capabilities

Introduced in R2014b