3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? date_default_timezone_set("America/New_York"); $timeStamp = 1352008800; $date= date(DateTime::ISO8601, $timeStamp); $dateTime = new DateTime(); $dateTime->setTimestamp($timeStamp); $dateFormat = date_format($dateTime, DateTime::ISO8601); echo "Date: $date DateFormat: $dateFormat\n";
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Date: 2012-11-04T01:00:00-0500 DateFormat: 2012-11-04T01:00:00-0400
Output for hhvm-3.10.0 - 3.12.0
Date: 2012-11-04T01:00:00-0500 DateFormat: 2012-11-04T01:00:00-0500
Output for 4.3.0 - 5.3.29
<? date_default_timezone_set("America/New_York"); $timeStamp = 1352008800; $date= date(DateTime::ISO8601, $timeStamp); $dateTime = new DateTime(); $dateTime->setTimestamp($timeStamp); $dateFormat = date_format($dateTime, DateTime::ISO8601); echo "Date: $date DateFormat: $dateFormat\n";