title: C# MVC and DateTime in action controller model
body: <p>I have this controller action :</p>
  
  <pre><code>[HttpGet]
  public ActionResult CreateForm(Models.ReminderModel model)
  {
      if (model.FkUserId == null &amp;&amp; model.FkRoleId == null) {
          model.FkUserId = UserSession.Current.UserId;
          model.ReminderDate = DateTime.UtcNow;
      }
  
      return View(model);
  }
  </code></pre>
  
  <p>The action behaves normally if no URL param is specified, but when I specify some data, everything gets set <em>BUT</em> <code>ReminderDate</code>. For example, the request is performed with </p>
  
  <pre><code>model[0][name]:FkUserId
  model[0][value]:2
  ....
  model[2][name]:ReminderDate
  model[2][value]:2013-03-09T10:33:04.934Z
  ...
  </code></pre>
  
  <p><strong>Note</strong> : the params are serialized view jQuery and always worked fine until now. It's the first time we try to pass a <code>DateTime</code> back to a controller action.</p>
  
  <p>In the action controller, <code>model.FKUserId</code> will correctly be set, however <code>ReminderDate</code> will be set to <code>"0001-01-01T00:00:00.000Z"</code>.</p>
  
  <p>What am I missing?</p>
  
  <p>** <strong>Update</strong> **</p>
  
  <p>As it turned out, C# will not work with ISO formatted date time strings. It prefers UTC ones. Something like <code>2013-03-05T16:23:00.000Z</code> needs to be sent as <code>u20130305212358000</code> (EST). A binding would've been sufficient as well, but I think this is the best solution.</p>