Convert datetime to GMT timestamp
<p>I need to find a way to convert a user specified date and time into a GMT timestamp.</p>

<p>Following the answer by Mahdi <a href="https://stackoverflow.com/questions/470617/get-current-date-and-time-in-php">here</a>, I'm using the following code to prototype the conversion</p>

<pre><code>$date = new DateTime("09 Jul 2016 18:00:00");
echo gmdate('Y-m-d H:i:s', $date-&gt;getTimestamp());
</code></pre>

<p>Which returns</p>

<blockquote>
  <p>2016-07-09 16:00:00</p>
</blockquote>

<p>What the response should be is </p>

<blockquote>
  <p>2016-07-09 17:00:00</p>
</blockquote>

<p>Because via using other sources I've worked out that the GMT time is 1 hour behind of the local time where I live (UK). </p>

<p>Any ideas why this peculiar behaviour is happening?</p>