1--TEST--
2Test gmdate() function : usage variation - Passing Timezone format options to format argument.
3--FILE--
4<?php
5echo "*** Testing gmdate() : usage variation ***\n";
6
7// Initialise all required variables
8date_default_timezone_set('Asia/Calcutta');
9$timestamp = mktime(8, 8, 8, 8, 8, 2008);
10
11echo "\n-- Testing gmdate() function with Timezone identifier format --\n";
12var_dump( gmdate('e') );
13var_dump( gmdate('e', $timestamp) );
14
15echo "\n-- Testing gmdate() function with checking whether date is in daylight saving time format --\n";
16var_dump( gmdate('I') );
17var_dump( gmdate('I', $timestamp) );
18
19echo "\n-- Testing gmdate() function with difference to GMT in hours format --\n";
20var_dump( gmdate('O') );
21var_dump( gmdate('O', $timestamp) );
22
23echo "\n-- Testing gmdate() function with Difference to GMT in hours using colon as separator format --\n";
24var_dump( gmdate('P') );
25var_dump( gmdate('P', $timestamp) );
26
27echo "\n-- Testing gmdate() function with timezone abbreviation format --\n";
28var_dump( gmdate('T') );
29var_dump( gmdate('T', $timestamp) );
30
31echo "\n-- Testing gmdate() function with timezone offset format --\n";
32var_dump( gmdate('T') );
33var_dump( gmdate('T', $timestamp) );
34
35?>
36--EXPECTF--
37*** Testing gmdate() : usage variation ***
38
39-- Testing gmdate() function with Timezone identifier format --
40string(3) "UTC"
41string(3) "UTC"
42
43-- Testing gmdate() function with checking whether date is in daylight saving time format --
44string(1) "%d"
45string(1) "%d"
46
47-- Testing gmdate() function with difference to GMT in hours format --
48string(5) "+0000"
49string(5) "+0000"
50
51-- Testing gmdate() function with Difference to GMT in hours using colon as separator format --
52string(6) "+00:00"
53string(6) "+00:00"
54
55-- Testing gmdate() function with timezone abbreviation format --
56string(3) "GMT"
57string(3) "GMT"
58
59-- Testing gmdate() function with timezone offset format --
60string(3) "GMT"
61string(3) "GMT"
62