title: Pass DateTime to Controller
body: <p>I want to pass DateTime that was selected in datetimepicker in controller.</p>
  
  <pre><code>@{
  ViewBag.Title = "Index";
  }
  
  &lt;h2&gt;Index&lt;/h2&gt;
  
  &lt;script src="~/Scripts/jquery-2.2.0.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/moment.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/Scripts/bootstrap-datetimepicker.min.js"&gt;&lt;/script&gt;
  
  &lt;link href="~/Content/bootstrap.min.css" rel="stylesheet" /&gt;
  &lt;link href="~/Content/bootstrap-datetimepicker.min.css" rel="stylesheet" /&gt;
  
  &lt;div class="container"&gt;
  &lt;div class="row"&gt;
      &lt;div class='col-sm-6'&gt;
          &lt;div class="form-group"&gt;
              &lt;div class='input-group date' id='datetimepicker1'&gt;
                  &lt;input type='text' class="form-control" /&gt;
                  &lt;span class="input-group-addon"&gt;
                      &lt;span class="glyphicon glyphicon-calendar"&gt;&lt;/span&gt;
                  &lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript"&gt;
          $(function () {
              $('#datetimepicker1').datetimepicker();
          });
      &lt;/script&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public class HomeController : Controller
  {
      //
      // GET: /Home/
  
      public ActionResult Index()
      {
          return View();
      }
  
      public ActionResult GetData(DateTime dateTime)
      {
          return View();
      }
  }
  </code></pre>
  
  <p>What is the best way to do this? Use Ajax?
  How to do it correct?</p>
  
  <pre><code> $.ajax({
      url: "/Home/GetData",
      type: "POST",
      dataType: "json",
      data: JSON.stringify(????),
      contentType: "application/json; charset=utf-8",
      success: function (result) { }, 
      failure: function (r, e, s) { alert(e); } 
   });
  </code></pre>