Annotation of embedaddon/php/ext/date/tests/gmdate_variation10.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test gmdate() function : usage variation - Passing Timezone format options to format argument.
3: --FILE--
4: <?php
5: /* Prototype : string gmdate(string format [, long timestamp])
6: * Description: Format a GMT date/time
7: * Source code: ext/date/php_date.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing gmdate() : usage variation ***\n";
12:
13: // Initialise all required variables
14: date_default_timezone_set('Asia/Calcutta');
15: $timestamp = mktime(8, 8, 8, 8, 8, 2008);
16:
17: echo "\n-- Testing gmdate() function with Timezone identifier format --\n";
18: var_dump( gmdate('e') );
19: var_dump( gmdate('e', $timestamp) );
20:
21: echo "\n-- Testing gmdate() function with checking whether date is in daylight saving time format --\n";
22: var_dump( gmdate('I') );
23: var_dump( gmdate('I', $timestamp) );
24:
25: echo "\n-- Testing gmdate() function with difference to GMT in hours format --\n";
26: var_dump( gmdate('O') );
27: var_dump( gmdate('O', $timestamp) );
28:
29: echo "\n-- Testing gmdate() function with Difference to GMT in hours using colon as separator format --\n";
30: var_dump( gmdate('P') );
31: var_dump( gmdate('P', $timestamp) );
32:
33: echo "\n-- Testing gmdate() function with timezone abbreviation format --\n";
34: var_dump( gmdate('T') );
35: var_dump( gmdate('T', $timestamp) );
36:
37: echo "\n-- Testing gmdate() function with timezone offset format --\n";
38: var_dump( gmdate('T') );
39: var_dump( gmdate('T', $timestamp) );
40:
41: ?>
42: ===DONE===
43: --EXPECTF--
44: *** Testing gmdate() : usage variation ***
45:
46: -- Testing gmdate() function with Timezone identifier format --
47: string(3) "UTC"
48: string(3) "UTC"
49:
50: -- Testing gmdate() function with checking whether date is in daylight saving time format --
51: string(1) "%d"
52: string(1) "%d"
53:
54: -- Testing gmdate() function with difference to GMT in hours format --
55: string(5) "+0000"
56: string(5) "+0000"
57:
58: -- Testing gmdate() function with Difference to GMT in hours using colon as separator format --
59: string(6) "+00:00"
60: string(6) "+00:00"
61:
62: -- Testing gmdate() function with timezone abbreviation format --
63: string(3) "GMT"
64: string(3) "GMT"
65:
66: -- Testing gmdate() function with timezone offset format --
67: string(3) "GMT"
68: string(3) "GMT"
69: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>