title: .ToUniversalTime(), why it works this way?
body: <p>I noticed this strange issue regarding .ToUniversalTime(), but I can't figure out why. </p>
  
  <p>If I do </p>
  
  <pre><code> DateTime currentServerTime = System.DateTime.Now;
   DateTime currentUTCServerTime = currentServerTime.ToUniversalTime();
  
   log.Debug("Current server time :" + currentServerTime);
   log.Debug("Current Server UTC Time is :" + currentUTCServerTime);
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <pre><code>  Current server time :2/18/2014 2:09:23 PM
    Current Server UTC Time is :2/18/2014 7:09:23 PM
  </code></pre>
  
  <p><strong>5 hours apart.</strong></p>
  
  <p>Given the server is located on U.S East Coast, with -5 offset. That's correct. </p>
  
  <p>Now if I do</p>
  
  <pre><code>String dateTimeString = "7/10/2013";
  DateTime baseLined = Convert.ToDateTime(dateTimeString);
  DateTime convertedUTCTime = baseLined.ToUniversalTime();
  
  log.Debug(dateTimeString + " is :"+baseLined);
  log.Debug(dateTimeString + " UTC time is :" + convertedUTCTime);
  </code></pre>
  
  <p><strong>Result</strong></p>
  
  <pre><code>7/10/2013 is : 7/10/2013 12:00:00 AM
  7/10/2013 UTC time is: 7/10/2013 4:00:00 AM
  </code></pre>
  
  <p><strong>4 hours apart.</strong></p>
  
  <p>Why one result shows 5 hours difference and another shows 4????</p>
  
  <p>Please help. </p>
  
  <p>=== Edit ====</p>
  
  <p>Thanks to Jon and Usr. Now I understand .ToUniversalTime() will take DST of the server into consideration and adjust the UTC according to the DateTime object it attaches to. </p>
  
  <p>So I'm still trying to wrap my head around it for this situation. </p>
  
  <p>In my database, 7/10/2013 is a due date and was recorded as "7/10/2013 4:00:00 AM" (Since during that time, it was during daylight saving, offset -4).  </p>
  
  <p>Now it's in Feburary 2014, DST is not in effect, offset is now -5. But because of this, when I adjust user's timezone offset -5 to "7/10/2013 4:00:00 AM", it becomes 7/09/2013 instead of 7/10/2013. </p>
  
  <p>How do I handle this situation?</p>