title: Comparing time regardless of date
body: <p>I have an object that has properties currently as DateTime. </p>
  
  <p>The object is marked as valid within a time frame. The default being 00:00:00 to 23:59:59</p>
  
  <p>The user enters the value in the UI and the property is set via:</p>
  
  <pre><code>new DateTime(DateTime.Now.Year, 
               DateTime.Now.Month, 
               DateTime.Now.Day, 
               model.Hours, 
               model.Minutes, 
               model.Seconds)
  </code></pre>
  
  <p><strong>This is then converted to UTC when it hits the database.</strong></p>
  
  <p>Today's date is 29th August 2013. If a colleague in India runs this program it will store the data in the database as 28th August 2013 18:30:00 as they are 5.5 hours ahead of UTC so 29th August 2013 00:00:00 becomes yesterday.</p>
  
  <p>When the logic tries to determine if the object is valid the logic is:</p>
  
  <pre><code>if (DateTime.UtcNow.TimeOfDay &gt; model.MyPropertyFromDB.TimeOfDay)
  </code></pre>
  
  <p><strong>We are trying to determine if the current time is within a range of 00:00:00 and 23:59:59</strong></p>
  
  <p>This fails as 14:00 (current time) is not greater than 18:30</p>
  
  <p>What would be the best approach to compare just times?</p>
  
  <p>Would storing the values as DateTimeOffSet help, is using ToLocal() ok? </p>
  
  <p>Other considerations are that a user in India is using the app which is hosted in the UK so it needs to be timezone aware.</p>
  
  <p>Thanks</p>