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