Main Content

isdst

Determine daylight saving time elements

Syntax

Description

example

tf = isdst(t)returns an array the same size astcontaining logical 1 (true) where the corresponding element oftis a datetime that occurs during Daylight Saving Time, and logical 0 (false) otherwise.isdstreturnsfalsefor all elements when theTimeZoneproperty oftis empty ('').

Examples

collapse all

t = datetime(2014,3,7:11,'TimeZone','America/New_York')
t =1x5 datetime07-Mar-2014 08-Mar-2014 09-Mar-2014 10-Mar-2014 11-Mar-2014
tf = isdst(t)
tf =1x5 logical array0 0 0 1 1

March 10 and March 11, 2014 in theAmerica/New_Yorktime zone occur during daylight saving time.

Input Arguments

collapse all

Input date and time, specified as adatetimearray.

Extended Capabilities

Introduced in R2014b