title: Passing PHP time through to JS
body: <p>I have been trying to plot some data from a database using canvasJS. I currently have it so it takes my data, encodes it as json and passes it back where it is plotted on a line graph and this works fine but it simply uses numerical values of 0, 1 , 2 , 3 ... for the x values. </p>
  
  <p>Now I would like to take the times I also have in the database and use these as x values. When I simply take them and stick them in the json encode they are added as strings in the format (hh:mm:ss) </p>
  
  <p>When I use <code>strtotime($row['time'])</code> they are converted to timestamps and plotted but these make no sense. How can I convert them back to javascript times that make more sense when plotted? </p>
  
  <p>here is the code that does the ajax call:</p>
  
  <pre><code>  $.post( "display_ajax.php", { hour: $("#slider-range").slider("values",0)+":"+$("#slider-range").slider("values",1)}, function( datax ) {
  
  console.log(datax);
    dataPoints = datax;
          dataSeries.dataPoints = dataPoints;
       data.push(dataSeries); 
       console.log(dataPoints);
  
    draw_chart ();
  
  
  
    },"json");
  </code></pre>
  
  <p>where the data being passed is two values taken from a jquery slider that correspond to a time range. </p>