Annotation of embedaddon/php/ext/date/tests/DateTime_setDate_basic1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test DateTime::setDate() function : basic functionality
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : public DateTime DateTime::setDate ( int $year , int $month , int $day )
! 6: * Description: Resets the current date of the DateTime object to a different date.
! 7: * Source code: ext/date/php_date.c
! 8: * Alias to functions: date_date_set()
! 9: */
! 10:
! 11: //Set the default time zone
! 12: date_default_timezone_set("Europe/London");
! 13:
! 14: echo "*** Testing DateTime::setDate() : basic functionality ***\n";
! 15:
! 16: $datetime = new DateTime("2009-01-30 19:34:10");
! 17:
! 18: echo $datetime->format(DATE_RFC2822) . "\n";
! 19:
! 20: $datetime->setDate(2008, 02, 01);
! 21:
! 22: echo $datetime->format(DATE_RFC2822) . "\n";
! 23:
! 24: ?>
! 25: ===DONE===
! 26: --EXPECTF--
! 27: *** Testing DateTime::setDate() : basic functionality ***
! 28: Fri, 30 Jan 2009 19:34:10 +0000
! 29: Fri, 01 Feb 2008 19:34:10 +0000
! 30: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>