3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTime('1 day ago', new DateTimeZone('Europe/Amsterdam')); printf("%s\t%s\n", $dateTime->format('Y-m-d H:i:s'), $dateTime->getTimezone()->getOffset($dateTime)); $dateTime->modify('-1 month'); printf("%s\t%s\n", $dateTime->format('Y-m-d H:i:s'), $dateTime->getTimezone()->getOffset($dateTime)); $dateTime->modify('+1 month'); printf("%s\t%s\n", $dateTime->format('Y-m-d H:i:s'), $dateTime->getTimezone()->getOffset($dateTime)); $dateTime->modify('next month'); printf("%s\t%s\n", $dateTime->format('Y-m-d H:i:s'), $dateTime->getTimezone()->getOffset($dateTime));
based on 272FF
Output for 5.6.0 - 7.3.0alpha1
2016-10-31 09:50:21 3600 2016-10-01 09:50:21 7200 2016-11-01 09:50:21 3600 2016-12-01 09:50:21 3600