2 date_default_timezone_set('UTC');
3 /* Prototype : void date_add(DateTime object, DateInterval interval)
4 * Description: Adds an interval to the current date in object.
5 * Source code: ext/date/php_date.c
9 echo "*** Testing date_add() : basic functionality ***\n";
11 // Initialise all required variables
12 $startDate = '2008-01-01 12:25';
13 $format = 'Y-m-d H:i:s';
21 $d = new DateTime($startDate);
22 var_dump( $d->format($format) );
24 foreach($intervals as $interval) {
25 date_add($d, new DateInterval($interval) );
26 var_dump( $d->format($format) );