3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $creation_date = new DateTime('2016-09-07 06:00:00', new DateTimeZone('Asia/Kolkata')); $expiration_date = new DateTime('2016-09-07 06:00:00', new DateTimeZone('Asia/Kolkata')); $expiration_date->add(new DateInterval('PT12H')); echo "Creation Date: ".$creation_date->format('Y-m-d H:i')."\n\nExpiration Date: ".$expiration_date->format('Y-m-d H:i');
based on 9XRaq
Output for 5.6.0 - 7.3.0rc6
Creation Date: 2016-09-07 06:00 Expiration Date: 2016-09-07 18:00