1--TEST-- 2Test DateTime::modify() function : basic functionality 3--FILE-- 4<?php 5 //Set the default time zone 6date_default_timezone_set("Europe/London"); 7 8echo "*** Testing DateTime::modify() : basic functionality ***\n"; 9 10// Create a date object to modify 11$datetime = new DateTime("2009-01-31 14:28:41"); 12 13$datetime->modify("+1 day"); 14echo "After modification 1: " . $datetime->format("D, d M Y") . "\n"; 15 16$datetime->modify("+1 week 2 days 4 hours 2 seconds"); 17echo "After modification 2: " . $datetime->format("D, d M Y H:i:s") . "\n"; 18 19$datetime->modify("next Thursday"); 20echo "After modification 3: " . $datetime->format("D, d M Y") . "\n"; 21 22$datetime->modify("last Sunday"); 23echo "After modification 4: " . $datetime->format("D, d M Y") . "\n"; 24 25?> 26--EXPECT-- 27*** Testing DateTime::modify() : basic functionality *** 28After modification 1: Sun, 01 Feb 2009 29After modification 2: Tue, 10 Feb 2009 18:28:43 30After modification 3: Thu, 12 Feb 2009 31After modification 4: Sun, 08 Feb 2009 32