Mysql DATE field selected in format yyyy-MM-ddTHH:mm:ss-HH:mm
<p>I'm using JqxCharts from JqWidgets.</p>

<p>Using a PHP file to get Json data for the Graph.</p>

<p>In Mysql query I do something like this:</p>

<pre><code>SELECT fecha, Qty
FROM somedatabase

2016-05-01     5
2016-07-21     55
2016-08-16     33
</code></pre>

<p>The "fecha" field is simple DATE format.
But when it display  in the graph I always get a wrong date (1 day less)</p>

<p><a href="http://www.jqwidgets.com/community/topic/date-datafield-timezone-handling/" rel="nofollow noreferrer">Apparently it has to do something with Date Format conversion from javascript.</a></p>

<p>And I need to get the date from MySql in format "yyyy-MM-ddTHH:mm:ss-HH:mm"</p>

<p>How can I get this format from my actual Query?</p>

<p><strong>UPDATE: SOLVED.</strong></p>

<p>Thanks to "tadman", to help me to understand. I searched how to select Mysql ISO 8601, <a href="https://stackoverflow.com/questions/9321809/format-date-in-mysql-select-as-iso-8601">so I found</a> </p>

<p>So now I just updated the Query to:</p>

<pre><code>SELECT DATE_FORMAT(fecha, '%Y-%m-%dT%T-06:00'), Qty
FROM somedatabase
</code></pre>

<p>By the way if someone is looking for this, the "T-06:00" is the UTC for Mexico.</p>