title: How to display the right timestamp when select query in mysql?
body: <p>I would like display the right timestamp of my query. The date in my database is this one and date timestamp is set in <strong>Europe/Berlin</strong>. That is in my server setup and I always get this result.</p>
  
  <blockquote>
    <p>2017-05-26 09:05:58</p>
  </blockquote>
  
  <p>I want to display the date from my query. here is the code of my query</p>
  
  <pre><code>select logs.action_date_time from AuditLogs
  </code></pre>
  
  <p>How can I convert the logs.action_date_time date in my place here in Philippines? I supposed to see this result</p>
  
  <blockquote>
    <p>2017-05-26T09:05:58+02:00</p>
  </blockquote>
  
  <p>I search it in google the unix_timestamp but I don't see any sample that they use in select before from query. I'm using symfony for this. I just give summary of what the result of my above sample code. </p>
  
  <pre><code>const SELECT =
          'SELECT logs.id, logs.object_id AS objectId, logs.object_type AS objectType, logs.object_name AS objectName, '.'logs.action, logs.action_date_time AS actionDateTime, logs.action_status AS actionStatus, logs.subject, logs.user, '.'logs.description, logs.ip, logs.param03_value AS userId, logs.param04_value AS userDisplayName ';
  
      public function getNext($params)
      {
          // Hardcode for now
          $limit = $params['limit'] ? (int) $params['limit'] : self::DEFAULT_LIMIT;
          $limit++;
  
          $select = self::SELECT;
          $whereClause = $this-&gt;constructWhereClause($params);
  
          $sql = "
              $select FROM spoke.audit_logs AS logs
              $whereClause
              ORDER BY logs.action_date_time DESC, logs.id DESC
              LIMIT $limit";
  
          if ($params['cursor']) {
              $now = new \DateTime();
              $datetime = $now-&gt;getTimestamp();
              if (isset($params['datetime'])) {
                  $datetime = $params['datetime'];
              }
              $whereClause = $this-&gt;constructWhereClause($params, 'logs1', false);
              $sql = "
                  $select
                  FROM spoke.audit_logs logs1, spoke.audit_logs logs
                  WHERE logs1.id = logs.id 
                      $whereClause
                      AND logs1.action_date_time &lt;= '$datetime'
                      AND (logs1.id &lt; {$params['cursor']} OR logs1.action_date_time &lt; '$datetime')
                  ORDER BY logs1.action_date_time DESC, logs1.id DESC
                  LIMIT $limit";
          }
          $stmt = $this-&gt;getEntityManager()-&gt;getConnection()-&gt;query($sql);
  
          return $stmt-&gt;fetchAll(\PDO::FETCH_ASSOC);
  
      }
  </code></pre>