Getting the offset from timezone or date and time, supporting the daylight saving php
<p>I fetch <code>$getdate</code> from database. <code>$getdate</code> is in <code>'Y-m-d H:i:s'</code> format.
then i convert the datetime to another timezone.</p>

<pre><code>$date = new DateTime($getdate, new DateTimeZone('Asia/Calcutta'));
$date-&gt;setTimezone(new DateTimeZone('Europe/Paris'));
$paristime = $date-&gt;format('Y-m-d H:i:s');
</code></pre>

<p>I want to know, how can i get offset from <code>$paristime</code> that supports daylight saving also.</p>

<p>after searching on internet, managed to get the offset</p>

<pre><code>   $date = new DateTime($getdate, new DateTimeZone('Asia/Calcutta'));
   $dtz = new DateTimeZone('Europe/Paris');
   $date-&gt;setTimezone($dtz);
   $fr = $date-&gt;format('Y-m-d H:i:s');
   $fr = new DateTime($fr, $dtz);

   $offset = $dtz-&gt;getOffset($fr) / 3600;
</code></pre>

<p>Now, can anyone tell me if this will support daylight saving or not ???</p>
