MATLAB Help Center
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).
t
1
true
0
false
example
collapse all
Define an array.
A = [datetime('now');datetime('tomorrow');datetime(2016,1,15)]
A = 3×1 datetime 01-Feb-2025 09:01:55 02-Feb-2025 00:00:00 15-Jan-2016 00:00:00
Determine if the array is a datetime array.
datetime
tf = isdatetime(A)
tf = logical 1
Input array, specified as a scalar, vector, matrix, or multidimensional array. t can be any data type.
expand all
backgroundPool
ThreadPool
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
Introduced in R2014b
datetime | isduration | iscalendarduration
isduration
iscalendarduration
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
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.
Americas
Europe
Asia Pacific
Contact your local office