NaT
Not-a-Time
Syntax
Description
NaT
is the representation for Not-a-Time,
a value that can be stored in a datetime
array
to indicate an unknown or missing datetime
value.
The datetime
function creates a NaT
value
automatically when it cannot convert text to a datetime
value, or for
elements in a datetime
array where the Year
,
Month
, Day
, Hour
,
Minute
, or Second
properties are set to
NaN
. You also can assign missing
values to elements of an existing datetime
array. Use the NaT
function to create a new
datetime
array containing only NaT
values.
NaT
returns a scalar Not-a-Time (NaT
) datetime
value.
t = NaT(
returns
an n
)n
-by-n
matrix of NaT
values.
t = NaT(
returns
a sz1,...,szN
)sz1
-by-...-by-szN
array of NaT
values
where sz1,...,szN
indicates the size of each dimension.
For example, NaT(3,4)
returns a 3-by-4 array of NaT
values.
t = NaT(
returns
an array of sz
)NaT
values where the size vector, sz
,
defines size(t)
. For example, NaT([3,4])
returns
a 3-by-4 array of NaT
values.
t = NaT(___,'Format',
returns
a fmt
)datetime
array with the specified display format.
Use this syntax to initialize a datetime
array.
Not-a-Time values always display as NaT
, but non-NaT
values
assigned to the array will display using the specified format.
t = NaT(___,'TimeZone',
returns
an array of tz
)NaT
values in the time zone specified
by tz
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2015b
See Also
isnat
| datetime
| NaN
| leapseconds