title: How do I change the date format?
body: <p>This is my js function to fetch data from database. The data is being dynamically appended data to my modal popup from the js page. Currently the date format shown, is &quot;2018-06-09 15:43:44&quot;(as stored in database). I wish to <strong>change the date format that is being displayed</strong> to dd-MMM-YYYY. Is there a way to achieve this?</p>
  <pre><code>function fetch(url, id) {
      $.ajax({
          type: 'GET',
          url: url + id,
          headers: {
              'X-CSRF-TOKEN': $(`meta[name='_token']`).attr('content')
          },
          success: function (r) {
              let data = r;
  //json value passed from controller in obj
              data = data.obj;
              let rows = '';
              $(data).each(function (index, row) {
                  rows += `
                     &lt;tr&gt;
                              &lt;td&gt;${row.company_name}&lt;/td&gt;
                              &lt;td&gt;${row.created_at}&lt;/td&gt;
                     &lt;/tr&gt;
              `;
              })
              $('.modalPage').html(rows);
          }
      });
  }
  </code></pre>