isdst - Determine daylight saving time elements - MATLAB (original) (raw)

Main Content

Determine daylight saving time elements

Syntax

Description

tf = isdst([t](#bugc7zg-1%5Fsep%5Fshared-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 ('').

example

Examples

collapse all

t = datetime(2014,3,7:11,'TimeZone','America/New_York')

t = 1×5 datetime 07-Mar-2014 08-Mar-2014 09-Mar-2014 10-Mar-2014 11-Mar-2014

tf = 1×5 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

expand all

Theisdst function fully supports tall arrays. For more information, see Tall Arrays.

Version History

Introduced in R2014b