1--TEST--
2Test DateTime::setISODate() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : public DateTime DateTime::setISODate  ( int $year  , int $week  [, int $day  ] )
6 * Description: Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates.
7 * Source code: ext/date/php_date.c
8 * Alias to functions: date_isodate_set
9 */
10
11echo "*** Testing DateTime::setISODate() : basic functionality ***\n";
12
13//Set the default time zone
14date_default_timezone_set("Europe/London");
15
16// Create a deate object
17$datetime = new DateTime("2009-01-30 17:57:32");
18
19// Which month is week 40 ?
20$datetime->setISODate(2008, 40);
21echo "Week 40 of 2009 is in \"" . $datetime->format("F") . "\"\n";
22
23// What date is week  week 30 day 3 ?
24$datetime->setISODate(2009, 30, 3);
25echo "Week 30 day 3 of 2009 is \"" . $datetime->format("D M j") . "\"\n";
26
27// What date was is last year  ?
28$datetime->setISODate(2008, 30, 3);
29echo "..same day last year was \"" . $datetime->format("D M j") . "\"\n";
30
31?>
32===DONE===
33--EXPECTF--
34*** Testing DateTime::setISODate() : basic functionality ***
35Week 40 of 2009 is in "September"
36Week 30 day 3 of 2009 is "Wed Jul 22"
37..same day last year was "Wed Jul 23"
38===DONE===
39