title: Http Query Parameters in UTC in AspNet Core
body: <p>I'm having an issue that I cannot figure out.</p>
  
  <p>I try to deal ALWAYS with UTC DateTime at server side.</p>
  
  <p>I have an AspNetCore Mvc application with an endpoint that accepts queries that may include DateTimes. I want Mvc to understand that these dates are already in UTC and not to transform them "again".</p>
  
  <p>My system is in Spain, (UTC +2)</p>
  
  <p>If I send an http request to my localhost server like this:</p>
  
  <pre><code>http://localhost:50004/api/Resources?appliesOn=2018-06-30T18:00:00.000Z
  </code></pre>
  
  <p>I want to have the deserialized datetime as UTC representing the same date as:</p>
  
  <pre><code>DateTime.SpecifyKind(new DateTime(2018, 6, 30, 18, 0, 0), DateTimeKind.Utc)
  </code></pre>
  
  <p>But I can see that Mvc always transforms the date 2018-06-30T18:00:00.000Z into two hours later: 2018-06-30 20:00:00</p>
  
  <p>I have tried to tell Mvc to use UTC json serializer/deserializer but nothing changes:</p>
  
  <pre><code>services
    .AddMvc()
    .AddJsonOptions(options =&gt;
    {
        options.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
    });
  </code></pre>
  
  <p>Is there a way to send query parameters in an http GET request already as a representation of UTC datetime? I understood a Date in ISO 8601, if it has a suffix Z it means "zero-offset" which should be interpreted already as UTC date time. Why Mvc is then transforming this and adding 2 hours offset?</p>
  
  <p>Any clarification would be much appreciated!</p>
  
  <p>PS: This is my endpoint, nothing special as you can see:</p>
  
  <pre><code>[HttpGet("")]
  public IActionResult GetResources()
  {
      var displayUri = Request.GetDisplayUrl();
      var requestUri = new Uri(displayUri);
      var filter = _filteredRequestFactory.Create(requestUri);
      var resources = _myProjection.GetResourcers(filter);
      return Ok(resources);
  }
  </code></pre>