title: CTimeSpan.GetDays() and daylight savings time
body: <p>I found in a bug in an old C++ MFC program we have that calculates an offset (in days) for a given date from a fixed base date.  We were seeing results that were off by one for some reason, and I tracked it down to where the original programmer had used the CTimeSpan.GetDays() method.  According to the <a href="http://msdn.microsoft.com/en-us/library/14zezc9x.aspx" rel="nofollow noreferrer">documentation</a>:</p>
  
  <blockquote>
    <p>Note that Daylight Savings Time can cause GetDays to return a potentially surprising result. For example, when DST is in effect, GetDays reports the number of days between April 1 and May 1 as 29, not 30, because one day in April is shortened by an hour and therefore does not count as a complete day.</p>
  </blockquote>
  
  <p>My proposed fix is to use <code>(obj.GetTotalHours()+1)/24</code> instead.  I think that would cover all the issues since this is a batch job that runs at about the same time every day, but I thought I'd ask the smart people here before implementing it if there might be a better way.  </p>
  
  <p>This is just a side issue, but I'm also curious how this would be handled if the program could be run at any time.</p>