1--TEST--
2Test DateTime::setTime() function : basic functionality
3--FILE--
4<?php
5 //Set the default time zone
6date_default_timezone_set("Europe/London");
7
8echo "*** Testing DateTime::setTime() : basic functionality ***\n";
9
10// Create a DateTime object
11$datetime = new DateTime("2009-01-31 15:14:10");
12
13echo "Initial date: " . $datetime ->format(DATE_RFC2822) . "\n";
14
15$datetime->setTime(17, 20);
16echo "After modification1 " . $datetime ->format(DATE_RFC2822) . "\n";
17
18$datetime->setTime(19, 05, 59);
19echo "After modification2 " . $datetime ->format(DATE_RFC2822) . "\n";
20
21$datetime->setTime(24, 10);
22echo "After modification3 " . $datetime ->format(DATE_RFC2822) . "\n";
23
24$datetime->setTime(47, 35, 47);
25echo "After modification4 " . $datetime ->format(DATE_RFC2822) . "\n";
26
27$datetime->setTime(54, 25);
28echo "After modification5 " . $datetime ->format(DATE_RFC2822) . "\n";
29
30?>
31--EXPECT--
32*** Testing DateTime::setTime() : basic functionality ***
33Initial date: Sat, 31 Jan 2009 15:14:10 +0000
34After modification1 Sat, 31 Jan 2009 17:20:00 +0000
35After modification2 Sat, 31 Jan 2009 19:05:59 +0000
36After modification3 Sun, 01 Feb 2009 00:10:00 +0000
37After modification4 Mon, 02 Feb 2009 23:35:47 +0000
38After modification5 Wed, 04 Feb 2009 06:25:00 +0000
39