title: How to retrieve data from mysql according to current user timezone
body: <p>I have a database table storing orders made by my customers</p>
  
  <p>Now I am trying to draw a line chart based on total order made by user on daily basis, but since orders date time is saved separated in utc format, the graph is not correct, I have written following query</p>
  
  <pre><code>SELECT count(*) AS RECORD_COUNT,cast(concat(vtiger_salesorder.purchase_date,' ', vtiger_salesorder.purchase_time) as DATETIME) AS 'SalesOrder_Purchase_Date_and_Time_Day' ,`vtiger_salesorder`.`purchase_date` FROM vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid WHERE vtiger_salesorder.salesorderid &gt; 0 AND vtiger_crmentity.deleted=0 and (( vtiger_salesorder.purchase_date BETWEEN '2016-06-08 07:00:00' AND '2016-07-08 06:59:59' ) ) GROUP BY SalesOrder_Purchase_Date_and_Time_Day ORDER BY `vtiger_salesorder`.`purchase_date` ASC
  </code></pre>
  
  <p>For e.g If I have two orders with date time as 2016-04-03 03:00:00
  then for 2014-04-02 it should show 1 and 0 for 03 but it is giving 1 for 03 and 0 for 02 according to EST timezone</p>
  
  <p>What can i do?</p>