title: Why is there time difference between client and server on localhost
body: <p>Application is running on localhost. Server is one hour earlier than client! </p>
  
  <p>Client sends time : <code>Sat Apr 25 2015 00:00:00 GMT-0400 (Eastern Daylight Time)</code></p>
  
  <p><img src="https://i.stack.imgur.com/GdXJ1.png" alt="enter image description here"></p>
  
  <p>Request is sent:  <code>dateOfArrival: "2015-04-25T04:00:00.000Z"</code> </p>
  
  <p><img src="https://i.stack.imgur.com/Q2sk6.png" alt="enter image description here"></p>
  
  <p>Server receives time: <code>{4/24/2015 11:00:00 PM}</code></p>
  
  <p><img src="https://i.stack.imgur.com/yYwFK.png" alt="enter image description here">  </p>
  
  <p><strong>Why is there one hour difference between</strong> and how can I handle it? I could guess it is somehow related Daylight time vs Standart time.</p>
  
  <p>When I try this code: </p>
  
  <pre><code>string dateStr = "2015-04-25T04:00:00.000Z";  
  var myDate = DateTime.Parse(dateStr);  // it gives me myDate = {4/25/2015 12:00:00 AM}
  </code></pre>
  
  <p>Actually I am only interested day part of time. In my db, I am holding it as Date type. But because of this time difference, my days goes one day before.</p>
  
  <p>I tried various ways to handle issue but I got completely lost in datetime conversion world! Even I am lost on localhost application, I could not imagine what will happen on live server.</p>
  
  <p>I think <a href="https://stackoverflow.com/questions/4682255/the-datetime-parse-is-off-by-one-hour-why">this Q&amp;A</a> also mentions similar issue, but I can't figure it out
  if it matters:  </p>
  
  <p>My timezone: Eastern Time Zone (UTC-05:00)  </p>
  
  <p>About web api odata json serializer, <a href="https://stackoverflow.com/questions/20656229/json-net-as-a-webapi-2-odata-serializer-vs-odatamediatypeformatter">from this post</a> I could say that it is other then <a href="http://www.asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization" rel="nofollow noreferrer">this one</a></p>
  
  <p>Here is my server code:</p>
  
  <pre><code>// PATCH: odata/IncomingStudents(5)
  [AcceptVerbs("PATCH", "MERGE")]
  public async Task&lt;IHttpActionResult&gt; Patch([FromODataUri] int key, Delta&lt;IncomingStudent&gt; patch)
  {
      Validate(patch.GetEntity());
      var dateOfArrival = patch.GetEntity().DateOfArrival
  ... 
  }
  </code></pre>
  
  <p>Client is angularjs sending http patch request</p>