Annotation of embedaddon/php/ext/date/tests/date_basic1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test date() function : basic functionality
3: --FILE--
4: <?php
5: /* Prototype : string date ( string $format [, int $timestamp ] )
6: * Description: Format a local time/date.
7: * Source code: ext/date/php_date.c
8: */
9:
10: //Set the default time zone
11: date_default_timezone_set("Europe/London");
12:
13: echo "*** Testing date() : basic functionality ***\n";
14:
15: $timestamp = mktime(10, 44, 30, 2, 27, 2009);
16:
17: var_dump( date("F j, Y, g:i a", $timestamp) );
18: var_dump( date("m.d.y", $timestamp) );
19: var_dump( date("j, n, Y", $timestamp) );
20: var_dump( date("Ymd", $timestamp) );
21: var_dump( date('h-i-s, j-m-y, it is w Day', $timestamp) );
22: var_dump( date('\i\t \i\s \t\h\e jS \d\a\y.', $timestamp) );
23: var_dump( date("D M j G:i:s T Y", $timestamp) );
24: var_dump( date('H:m:s \m \i\s\ \m\o\n\t\h', $timestamp) );
25: var_dump( date("H:i:s", $timestamp) );
26:
27: ?>
28: ===DONE===
29: --EXPECT--
30: *** Testing date() : basic functionality ***
31: string(27) "February 27, 2009, 10:44 am"
32: string(8) "02.27.09"
33: string(11) "27, 2, 2009"
34: string(8) "20090227"
35: string(39) "10-44-30, 27-02-09, 4428 4430 5 Friam09"
36: string(19) "it is the 27th day."
37: string(28) "Fri Feb 27 10:44:30 GMT 2009"
38: string(19) "10:02:30 m is month"
39: string(8) "10:44:30"
40: ===DONE===
41:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>