title: Problem transmitting date over the network
body: <p>I have an MVC application that sends a date value from a server in USA as JSON format and it is displayed in a PC in Chile.</p>
  
  <p>Server side has this action in controller:</p>
  
  <pre><code>   public async Task&lt;ActionResult&gt; GetFacturas(Models.DataTableAjaxPostModel model)
      {
          // Some other code in between
          // ----
          return Json(fecha);   // fecha has the value of 2019-04-16 00:00:00
      }
  </code></pre>
  
  <p>By using  Chrome development tool, I see that the date is received in JSON object as 1555383600000.</p>
  
  <p>By using the site <a href="https://www.epochconverter.com/" rel="nofollow noreferrer">https://www.epochconverter.com/</a> I translated that date to a human readable format and I saw that it is:</p>
  
  <pre><code>GMT: Tuesday, 16 April 2019 3:00:00
  Your time zone: Monday, 15 April 2019 23:00:00 GMT-04:00
  </code></pre>
  
  <p>Even when MVC controller got date as 2019-04-16 00:00:00, it seems when Json serialized it, it was converted to GMT using -3 time zone, so, finally that GMT date was received by client computer, which in turn converted the date back to local time applying -4 operation.</p>
  
  <p>Operating system is configured as Time Zone -4, and MVC application is configured this way in web.config file:</p>
  
  <pre><code>&lt;globalization culture="es-CL" uiCulture="es-CL" /&gt;
  </code></pre>
  
  <p>How can I avoid this problem?</p>
  
  <p>EDIT:</p>
  
  <p>"fecha" variable is a DateTime object returned from a database, this way:</p>
  
  <pre><code>var fecha = db.Entity.Select(f =&gt; f.DatetimeField).FirstOrDefault();
  </code></pre>
  
  <p>Of course I simplified the query, but the fact is that "fecha", before returning the function, is a DateTime object whose value is 2019-04-16 00:00:00.</p>
  
  <p>Regards</p>
  
  <p>Jaime</p>