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 daylight saving time elements


tf = isdst(t)



tf = isdst(t) returns an array the same size as t containing logical 1 (true) where the corresponding element of t is a datetime that occurs during Daylight Saving Time, and logical 0 (false) otherwise. isdst returns false for all elements when the TimeZone property of t is empty ('').


collapse all

t = datetime(2014,3,7:11,'TimeZone','America/New_York')
t = 1x5 datetime array
   07-Mar-2014   08-Mar-2014   09-Mar-2014   10-Mar-2014   11-Mar-2014

tf = isdst(t)
tf = 1x5 logical array

   0   0   0   1   1

March 10 and March 11, 2014 in the America/New_York time zone occur during daylight saving time.

Input Arguments

collapse all

Input date and time, specified as a datetime array.

Extended Capabilities

Introduced in R2014b