isdatetime

Determine if input is datetime array

Description

example

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

Examples

collapse all

Define an array.

A = [datetime('now');datetime('tomorrow');datetime(2016,1,15)]
A = 3x1 datetime array
   26-Aug-2019 11:08:22
   27-Aug-2019 00:00:00
   15-Jan-2016 00:00:00

Determine if the array is a datetime array.

tf = isdatetime(A)
tf = logical
   1

Input Arguments

collapse all

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

Extended Capabilities

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

Introduced in R2014b