I'm fetching dates from MySQL as strings (Y-m-d format). I need to display a chart using Highcharts. Highcharts uses javascript Date.UTC function:
Return the number of milliseconds between a specified date and midnight January 1 1970.
data: [
[Date.UTC(1970, 9, 27), 0 ],
[Date.UTC(1970, 10, 10), 0.6 ],
[Date.UTC(1970, 10, 18), 0.7 ],
[Date.UTC(1970, 11, 2), 0.8 ],
[Date.UTC(1970, 11, 9), 0.6 ],
But i'd like to avoid javascript and do in in PHP (assigning a JSON object - the chart - to the page itself). What's the equivalent of Date.UTC function in PHP (regardless the server datezone)?
$date = '2012-07-07';
$millisecs = 1000 * unix_timestap_utc_regardless_server_zone($date);
date('Y, n-1, j-1', strtotime($date));and echo outDate.UTC($var)