Main Content

isdst

Determine daylight saving time elements

Description

example

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 ('').

Examples

collapse all

t = datetime(2014,3,7:11,'TimeZone','America/New_York')
t = 1x5 datetime
   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

Version History

Introduced in R2014b