title: return formatted date from WebMethod to JSON
body: <p>I have a WebMethod that returns at date {"d":["/Date(1390411800000)/"]}:</p>
  
  <pre><code>[WebMethod]
      public static object getBreadCrumbDate(int projectID, int statusID)
      {
          using (dbPSREntities5 myEntities = new dbPSREntities5())
          {
              var thisId = myEntities.tbBreadCrumbs.Where(x =&gt; x.ProjectID == projectID &amp;&amp; x.StatusID == statusID).Max(x =&gt; x.BreadCrumbID);
              var columns = myEntities.tbBreadCrumbs.Where(x =&gt; x.BreadCrumbID == thisId)
                                                    .Select(x =&gt; x.CreateDateTime).ToList();
  
              return columns;
          }
      }
  </code></pre>
  
  <p>and I want to format it "mmm dd, yy" (Jan 22, 14) and return it to the calling AJAX but not sure the best way. Here's my AJAX:</p>
  
  <pre><code>function getBreadCrumbDate(projectID, statusID) {
          $.ajax({
              url: "view-requests.aspx/getBreadCrumbDate",   // Current Page, Method
              data: JSON.stringify({
                  projectID: projectID,
                  statusID: statusID
              }), // parameter map as JSON
              type: "POST", // data has to be POSTed
              contentType: "application/json", // posting JSON content    
              dataType: "JSON",  // type of data is JSON (must be upper case!)
              timeout: 10000,    // AJAX timeout
              success: function (result) {
                  $("#divApprovedStatus").html(result.d[0]);
              },
              error: function (xhr, status) {
                  alert(status + " - " + xhr.responseText);
              }
          });
      }
  </code></pre>
  
  <p>Right now it prints out /Date(1390411800000)/ but want it formatted. Is it best to do in the jQuery after the success or in the C# when I return it? Whichever way, I'm not sure how to do it and could use some pointers.
  Thanks!</p>
  
  <p>It shows some red lines... do you want me to tell you what they say?
  <img src="https://i.stack.imgur.com/qdCbC.png" alt="enter image description here"></p>