title: ASP.NET MVC Json.Encode() DateTime encoding issue string not date type
body: <p>I am having an issue with the JavaScript that is produced by ASP.NET MVC's <code>System.Web.Helpers.Json.Encode()</code> if the model includes a <code>DateTime</code> property.</p>
  
  <p>My Model:</p>
  
  <pre><code>public class MyViewModel
  {
      public string MyString { get; set; }
      public DateTime MyDateTime { get; set; }
      public int MyInt { get; set; }
      public string[] MyStringArray { get; set; }
  }
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>public ActionResult Index()
  {
      var myViewModel = new MyViewModel();
      myViewModel.MyString = "My test string";
      myViewModel.MyInt = 100;
      myViewModel.MyDateTime = DateTime.Now;
      myViewModel.MyStringArray = new string[] { "string 1", "string 2" };
  
      return View(myViewModel);
  }
  </code></pre>
  
  <p>My View:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      var myViewModel = @Html.Raw(Json.Encode(Model)) ;
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The Output:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      var myViewModel = {"MyString":"My test string","MyDateTime":"\/Date(1372280916431)\/","MyInt":100,"MyStringArray":["string 1","string 2"]} ;
  
  &lt;/script&gt;
  </code></pre>
  
  <p>The issue is with the way the date is being encoded.  It is a string and not a Date type.</p>
  
  <p>I have also tried using <code>Newtonsoft.Json.JsonConvert.SerializeObject()</code> and I still get a string and not a Date type.</p>