PHP datetime diff wrong
<p>I am trying to get a difference between two DateTime objects in PHP and the answer seems to be wrong. As you can see the diff() function gives a time difference of 4 hours and 41 minutes, but the time difference is clearly much closer to 7 hours.</p>

<pre><code>$eastern_tz = new DateTimeZone( "US/Eastern" );

$now         = new DateTime( "now", $eastern_tz );
$future_date = new DateTime( $future_date_string ); //'2011-05-11 12:00:00'

$future_date-&gt;setTimezone( $eastern_tz );

$interval = $future_date-&gt;diff( $now );

var_dump( $now );
var_dump( $future_date );
var_dump( $interval );

return $interval-&gt;format( $format ); //"%d days, %h hours, %i minutes, %s seconds"
</code></pre>

<p>//DEBUG information</p>

<pre><code>object(DateTime)[483]
  public 'date' =&gt; string '2016-06-15 09:18:41' (length=19)
  public 'timezone_type' =&gt; int 3
  public 'timezone' =&gt; string 'US/Eastern' (length=10)
object(DateTime)[484]
  public 'date' =&gt; string '2016-06-15 14:00:00' (length=19)
  public 'timezone_type' =&gt; int 3
  public 'timezone' =&gt; string 'US/Eastern' (length=10)
object(DateInterval)[479]
  public 'y' =&gt; int 0
  public 'm' =&gt; int 0
  public 'd' =&gt; int 0
  public 'h' =&gt; int 4
  public 'i' =&gt; int 41
  public 's' =&gt; int 19
  public 'weekday' =&gt; int 0
  public 'weekday_behavior' =&gt; int 0
  public 'first_last_day_of' =&gt; int 0
  public 'invert' =&gt; int 1
  public 'days' =&gt; int 0
  public 'special_type' =&gt; int 0
  public 'special_amount' =&gt; int 0
  public 'have_weekday_relative' =&gt; int 0
  public 'have_special_relative' =&gt; int 0
</code></pre>