NaT
Not-a-Time
Syntax
Description
NaT
is the representation for Not-a-Time, a value that can be stored in adatetime
array to indicate an unknown or missingdatetime
value.
Thedatetime
function creates aNaT
value automatically when it cannot convert text to adatetime
value, or for elements in adatetime
array where theYear
,Month
,Day
,Hour
,Minute
, orSecond
properties are set toNaN
. You also can assign the character vector,'NaT'
, to elements of an existingdatetime
array. Use theNaT
function to create a newdatetime
array containing onlyNaT
values.
NaT
返回一个scalar Not-a-Time (NaT
)datetime
value.
t = NaT(
返回一个nn
)n
-by-n
matrix ofNaT
values.
t = NaT(
返回一个sz1,...,szN
)sz1
-by-...-by-szN
array ofNaT
values wheresz1,...,szN
indicates the size of each dimension. For example,NaT(3,4)
返回一个3-by-4 array ofNaT
values.
t = NaT(
返回一个n array ofsz
)NaT
values where the size vector,sz
, definessize(t)
. For example,NaT([3,4])
返回一个3-by-4 array ofNaT
values.
t = NaT(___,'Format',
返回一个fmt
)datetime
array with the specified display format. Use this syntax to initialize adatetime
array. Not-a-Time values always display asNaT
, but non-NaT
values assigned to the array will display using the specified format.
t = NaT(___,'TimeZone',
返回一个n array oftz
)NaT
values in the time zone specified bytz
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2015b