Function takes a date as a string in 'mm/dd/yyyy' format and outputs a
logical, true if the date is during daylight savings time for that year. See
definition of daylight savings time in the USA
Nate (2021). Daylight Savings Time (https://www.mathworks.com/matlabcentral/fileexchange/32263-daylight-savings-time), MATLAB Central File Exchange. Retrieved .
Can alter to accept Matlab time as input as follows,
Date = datestr(timeIn, 'mm/DD/YYYY');
Date = timeIn;
This only works for 2007 and onward. The date definition changed in 2007 by President Bush Jr. It would be helpful if this allowed for input of a vector of Matlab's "datenums" instead of a text string.
Pretty much does exactly what you would want it to do.
This is because these dates are during USA daylight savings time. The 2011 switch occured 11/06/2011, and therefore
is_Daylight_Savings('11/06/2011') = 0 (false)
is_Daylight_Savings('10/31/2011') = 1
so there is no problem.
Good idea, however something is not right...
All return 1's
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!