Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

isdst

Determine daylight saving time elements

Syntax

tf = isdst(t)

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 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

Was this topic helpful?