title: converting Mysql date to milliseconds in JSON using php
body: <p>I have RESTfully encoded JSON from MySQL using PHP, one column is date, which in MySQL comes like this 01/03/15 06:00, on JSON encoding it comes like this.</p>
  
  <pre><code>[["01/03/15 06:00","89"],["02/03/15 06:00","87"]]
  </code></pre>
  
  <p>How do i convert this to below code, where date in milliseconds timestamp</p>
  
  <pre><code>[["1420245000000","89"],["1422923400000","87"]]
  </code></pre>
  
  <p>PHP code for JSON Encode</p>
  
  <pre><code>private function productionhourlys(){   
          if($this-&gt;get_request_method() != "GET"){
              $this-&gt;response('',406);
          }
          $query="SELECT distinct  c.Date, c.RoA FROM productionhourlys c order by c.productionhourlyNumber desc";
          $r = $this-&gt;mysqli-&gt;query($query) or die($this-&gt;mysqli-&gt;error.__LINE__);
  
          if($r-&gt;num_rows &gt; 0){
              $result[] = array_values([]);
              while($row = $r-&gt;fetch_row()) {
                  $result[] = $row;
              }
              $this-&gt;response($this-&gt;json($result), 200); // send user details
          }
          $this-&gt;response('',204);    // If no records "No Content" status
      }
  </code></pre>