1--TEST--
2Test date_format() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : public string DateTime::format  ( string $format  )
6 * Description: Returns date formatted according to given format
7 * Source code: ext/date/php_date.c
8 * Alias to functions: date_format
9 */
10
11//Set the default time zone
12date_default_timezone_set("Europe/London");
13
14echo "*** Testing date_format() : basic functionality - formatting coinstants ***\n";
15$date = new DateTime("2005-07-14 22:30:41");
16
17var_dump( $date->format( DateTime::ATOM) ) ;
18var_dump( $date->format( DateTime::COOKIE) ) ;
19var_dump( $date->format( DateTime::ISO8601) ) ;
20var_dump( $date->format( DateTime::RFC822) ) ;
21var_dump( $date->format( DateTime::RFC850) ) ;
22var_dump( $date->format( DateTime::RFC1036) ) ;
23var_dump( $date->format( DateTime::RFC1123) ) ;
24var_dump( $date->format( DateTime:: RFC2822) ) ;
25var_dump( $date->format( DateTime::RFC3339) ) ;
26var_dump( $date->format( DateTime::RSS) ) ;
27var_dump( $date->format( DateTime::W3C) ) ;
28
29?>
30===DONE===
31--EXPECT--
32*** Testing date_format() : basic functionality - formatting coinstants ***
33string(25) "2005-07-14T22:30:41+01:00"
34string(32) "Thursday, 14-Jul-05 22:30:41 BST"
35string(24) "2005-07-14T22:30:41+0100"
36string(29) "Thu, 14 Jul 05 22:30:41 +0100"
37string(32) "Thursday, 14-Jul-05 22:30:41 BST"
38string(29) "Thu, 14 Jul 05 22:30:41 +0100"
39string(31) "Thu, 14 Jul 2005 22:30:41 +0100"
40string(31) "Thu, 14 Jul 2005 22:30:41 +0100"
41string(25) "2005-07-14T22:30:41+01:00"
42string(31) "Thu, 14 Jul 2005 22:30:41 +0100"
43string(25) "2005-07-14T22:30:41+01:00"
44===DONE===
45