1--TEST--
2Test date_isodate_set() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : DateTime date_isodate_set  ( DateTime $object  , 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: DateTime::setISODate
9 */
10
11echo "*** Testing date_isodate_set() : basic functionality ***\n";
12
13//Set the default time zone
14date_default_timezone_set("Europe/London");
15
16// Create a deate object
17$datetime = date_create("2009-01-30 17:57:32");
18
19// Which month is week 40 ?
20date_isodate_set($datetime, 2008, 40);
21echo "Week 40 of 2009 is in \"" . date_format($datetime, "F") . "\"\n";
22
23// What date is week  week 30 day 3 ?
24date_isodate_set($datetime, 2009, 30, 3);
25echo "Week 30 day 3 of 2009 is \"" . date_format($datetime, "D M j") . "\"\n";
26
27// What date was is last year  ?
28date_isodate_set($datetime, 2008, 30, 3);
29echo "..same day last year was \"" . date_format($datetime, "D M j") . "\"\n";
30
31?>
32===DONE===
33--EXPECTF--
34*** Testing date_isodate_set() : 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