title: kendo-ui grid date format from MySQL sql query
body: <p>I have looked here for similar queries, and none quite answer my question, either in its entirety, or in a fashion I can understand.</p>
  
  <p>I retrieve a string value from a MySQL database representing a datetime, i.e. "03 Oct, 2013 05:30:45PM" is represented as "20131003173045" in the database. This value is presented in a "Last Login" column in a Kendo Grid as a date. This is all contained within a PHP-oriented webpage using the MVC framework.</p>
  
  <p>Previously I applied a date format in the SQL query to change the string from "20131003173045" to "03 Oct, 2013 05:30:45PM", but this gets presented in the KendoGrid as a string, meaning November Dates can appear before October dates, April dates come up first etc. This understandably is not the desired function, especially when trying to sort by this column.</p>
  
  <p>Sample Code for the page rendering the KendoGrid:</p>
  
  <pre><code>&lt;div class="div1"&gt;
      &lt;div&gt;
          &lt;table id="listGrid"&gt;&lt;/table&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
      $(function() {
          $("#grid").kendoGrid({
              scrollable: false,
              groupable: false,
              sortable: {
                  mode: "multiple"
              },
              resizable: true,
              pageable: true,
              dataSource:
              {
                  transport:
                  {
                      read:  {
                          url: "&lt;?= $site_url ?&gt;Settings/Users/List",
                          dataType: "json"
                      },
                      parameterMap: function (model, operation) {
                          if (operation == "read") {
                              return model;
                          }                            
                          else if(model) {
                              return { "json" : kendo.stringify(model) };
                          }
                          else
                              return "";
                      }                    
                  },
                  pageSize: 20,
                  serverPaging: true,
                  serverSorting: true,
                  sort: { field: "LastLogin", dir: "desc" },
                  serverGrouping: true,
                  serverAggregates: false,
                  schema: {
                    total: "total",
                    data: "data",
                    groups: "groups"
                  }
              },
  
              toolbar: [ { title: "", template:'&lt;a class="k-button k-button-icontext k-grid-add" href="&lt;?= $site_url ?&gt;Settings/Users/Add/"&gt;Add New User&lt;/a&gt;' }],
              columns: [
                  //{field: "Id", width: "40px"},
                  {field: "UserName", title: "Alias", width: "160px"},
                  {field: "ForeName", title: "Forename", width: "100px"},
                  {field: "SurName", title: "Surname", width: "160px"},
                  {field: "Initials", width: "80px"},
                  {field: "CrmId", title: "CRM ID", width: "100px"},
                  {field: "Dept", title: "Department", width: "100px"},
                  {field: "Position"},
                  // Below is the field in question
                  {field: "LastLogin", title: "Last Login", width: "160px"}, 
                  {field: "BlockedStatus", title: "Status", width: "90px"},
                  { title: "", template:'&lt;a class="k-button k-button-icontext k-grid-edit" href="&lt;?= $site_url ?&gt;Settings/Users/Update/#: Id #"&gt;Edit&lt;/a&gt;' }
              ]
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>I've looked at the kendo.parseDate and kendo.toString, and combining the two, but can't seem to get anything to work; I either get "null" or "20131003173045", or the page doesn't load.</p>
  
  <p>I can't change the database data, I can only format it as part of the SQL query, which is what I was doing initially.</p>
  
  <p>I need the whole "20131003173045" string to become "03 Oct, 2013 05:30:45PM", and still be ordered in proper chronological order - how can I do this, and if the kendo.parseDate and kendo.toString are the correct tools to use, what am I doing wrong?</p>