<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153800</link>
    <title>MATLAB Central Newsreader - daylight savings adjustment</title>
    <description>Feed for thread: daylight savings adjustment</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 01 Aug 2007 17:52:42 -0400</pubDate>
      <title>daylight savings adjustment</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153800#385914</link>
      <author>Steve </author>
      <description>I have several years' worth of hourly data in Excel.  Times are given and they take into account daylight saving.  How can I locate all of the time data that is affected by daylight saving (as of 2007, it starts at 2:00 AM on the second Sunday in March and ends at 2:00 AM on the first Sunday in November) and subtract one hour from the values?&lt;br&gt;
&lt;br&gt;
This one has stumped me for a while now.  Any help is appreciated.  Thanks!</description>
    </item>
    <item>
      <pubDate>Wed, 01 Aug 2007 18:21:46 -0400</pubDate>
      <title>Re: daylight savings adjustment</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153800#385916</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;f8qh9a$l69$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Steve  &amp;lt;steveDEL.bachmeierDEL@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt;I have several years' worth of hourly data in Excel.  Times are given&lt;br&gt;
&amp;gt;and they take into account daylight saving.  How can I locate all of&lt;br&gt;
&amp;gt;the time data that is affected by daylight saving (as of 2007, it&lt;br&gt;
&amp;gt;starts at 2:00 AM on the second Sunday in March and ends at 2:00 AM on&lt;br&gt;
&amp;gt;the first Sunday in November) and subtract one hour from the values?&lt;br&gt;
&lt;br&gt;
How are the times encoded?&lt;br&gt;
&lt;br&gt;
datenum and datevec might be of assistance.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;law -- it's a commodity&quot;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Andrew Ryan (The Globe and Mail, 2005/11/26)</description>
    </item>
    <item>
      <pubDate>Wed, 01 Aug 2007 18:45:25 -0400</pubDate>
      <title>Re: daylight savings adjustment</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153800#385920</link>
      <author>Steve </author>
      <description>The dates are in Excel as 'd/m/yyyy'.  I transferred to Matlab and converted as follows:&lt;br&gt;
&lt;br&gt;
------&lt;br&gt;
&lt;br&gt;
[datanum datatxt dataraw]=xlsread('filename');&lt;br&gt;
&lt;br&gt;
dates=datatxt(3:end,1);  %These are of form 'd/m/yyyy'&lt;br&gt;
&lt;br&gt;
tdst=cell2mat(dataraw(3:end,2))*24;  %Converts times from form '3:00 PM' to form '15'&lt;br&gt;
&lt;br&gt;
------&lt;br&gt;
&lt;br&gt;
Now I need to take the 'tdst' values (daylight saving times) and subtract 1 - but only between the dates/times 2:00 AM on the second Sunday in March and 2:00 AM on the first Sunday in November.  The problem is that these datenums change, and so I'm currently trying to hunt down the dates using something like &lt;br&gt;
&lt;br&gt;
for time=t'&lt;br&gt;
march{time}=calendar(year(time),3);&lt;br&gt;
november{time}=calendar(year(time),11);&lt;br&gt;
startDSTloc=march(find(min(march(:,1)&amp;gt;0))+1,1);&lt;br&gt;
endDSTloc=november(find(min(november(:,1)&amp;gt;0)),1);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Then I'd somehow specifiy tstd=tdst-1 only for tdst between '3/march(startDSTloc,1)/year 2:00AM' and '11/november(endDSTloc,1)/year 2:00AM'.&lt;br&gt;
&lt;br&gt;
Any suggestions?  Thanks.&lt;br&gt;
&lt;br&gt;
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in message &amp;lt;f8qivq$dlm$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;f8qh9a$l69$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
&amp;gt; Steve  &amp;lt;steveDEL.bachmeierDEL@yahoo.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;I have several years' worth of hourly data in Excel.  Times are given&lt;br&gt;
&amp;gt; &amp;gt;and they take into account daylight saving.  How can I locate all of&lt;br&gt;
&amp;gt; &amp;gt;the time data that is affected by daylight saving (as of 2007, it&lt;br&gt;
&amp;gt; &amp;gt;starts at 2:00 AM on the second Sunday in March and ends at 2:00 AM on&lt;br&gt;
&amp;gt; &amp;gt;the first Sunday in November) and subtract one hour from the values?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; How are the times encoded?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; datenum and datevec might be of assistance.&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;   &quot;law -- it's a commodity&quot;&lt;br&gt;
&amp;gt;                          -- Andrew Ryan (The Globe and Mail, 2005/11/26)</description>
    </item>
    <item>
      <pubDate>Wed, 01 Aug 2007 19:14:41 -0400</pubDate>
      <title>Re: daylight savings adjustment</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/153800#385923</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;f8qkc5$pka$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Steve  &amp;lt;steveDEL.bachmeierDEL@yahoo.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;Now I need to take the 'tdst' values (daylight saving times) and&lt;br&gt;
&amp;gt;subtract 1 - but only between the dates/times 2:00 AM on the second&lt;br&gt;
&amp;gt;Sunday in March and 2:00 AM on the first Sunday in November.  The&lt;br&gt;
&amp;gt;problem is that these datenums change, and so I'm currently trying to&lt;br&gt;
hunt down the dates using something like&lt;br&gt;
&lt;br&gt;
&amp;gt;for time=t'&lt;br&gt;
&amp;gt;march{time}=calendar(year(time),3);&lt;br&gt;
&amp;gt;november{time}=calendar(year(time),11);&lt;br&gt;
&amp;gt;startDSTloc=march(find(min(march(:,1)&amp;gt;0))+1,1);&lt;br&gt;
&amp;gt;endDSTloc=november(find(min(november(:,1)&amp;gt;0)),1);&lt;br&gt;
&amp;gt;end&lt;br&gt;
&lt;br&gt;
I'm not sure what t is here, and I suspect you want startDSTloc&lt;br&gt;
and endDSTloc to be indexed by {time} . And since you are going&lt;br&gt;
over multiple years, you need to take into account that the rules&lt;br&gt;
changed this year.&lt;br&gt;
&lt;br&gt;
&amp;gt;Then I'd somehow specifiy tstd=tdst-1 only for tdst between '3/march(startDSTloc,1)/year 2:00AM' and '11/november(endDSTloc,1)/year 2:00AM'.&lt;br&gt;
&lt;br&gt;
Once you have figured out the appropriate start and stop times,&lt;br&gt;
datenum() them, and then the positions that need to be changed&lt;br&gt;
are the ones whose datenum() fall between the two values.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;law -- it's a commodity&quot;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Andrew Ryan (The Globe and Mail, 2005/11/26)</description>
    </item>
  </channel>
</rss>

