3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('-4 month', new \DateTimeZone('GMT')); //echo $date->format('m-d-Y'); $quarter = ceil($date->format('n') / 3); $year = $date->format('Y'); $month = $quarter * 3 + 1; $date = \DateTime::createFromFormat('Y-n-j H:i', strval($year+1)."-$month-1 00:00"); echo $date->format('d-m-Y H:i');
based on jAMRU
Output for 5.3.22 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
01-10-2016 00:00
Output for 5.5.24, 5.5.35, 5.6.21, 7.0.6
01-04-2017 00:00
Output for 5.5.25 - 5.5.34, 5.6.8 - 5.6.20, 7.0.0 - 7.0.5
01-01-2017 00:00