3v4l.org

run code in 200+ PHP versions simultaneously
<?php $dt = new DateTime('1/8/2019 12:00:00', new DateTimeZone('America/New_York')); $dt->sub('P7D'); var_dump($dt->format('c'));
based on RafK5
Output for 7.1.25 - 7.3.4
Warning: DateTime::sub() expects parameter 1 to be DateInterval, string given in /in/vUig9 on line 4 string(25) "2019-01-08T12:00:00-05:00"