1--TEST-- 2Test idate() function : usage variation - Passing supported Time format characters to format argument. 3--FILE-- 4<?php 5/* Prototype : int idate(string format [, int timestamp]) 6 * Description: Format a local time/date as integer 7 * Source code: ext/date/php_date.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing idate() : usage variation ***\n"; 12 13// Initialise function arguments not being substituted (if any) 14date_default_timezone_set("Asia/Calcutta"); 15 16//array of values to iterate over 17$inputs = array( 18 19 'Internet Time' => 'B', 20 '12 hour format' => 'h', 21 '24 hour format' => 'H', 22 'Minutes' => 'i', 23 'DST Activated' => 'I', 24 'Seconds' => 's', 25 'Seconds since Unix Epoch' => 'U', 26 'Time zone offset' => 'Z' 27); 28 29// loop through each element of the array for timestamp 30foreach($inputs as $key =>$value) { 31 echo "\n--$key--\n"; 32 var_dump( idate($value) ); 33}; 34?> 35===DONE=== 36--EXPECTF-- 37*** Testing idate() : usage variation *** 38 39--Internet Time-- 40int(%d) 41 42--12 hour format-- 43int(%d) 44 45--24 hour format-- 46int(%d) 47 48--Minutes-- 49int(%d) 50 51--DST Activated-- 52int(%d) 53 54--Seconds-- 55int(%d) 56 57--Seconds since Unix Epoch-- 58int(%d) 59 60--Time zone offset-- 61int(%d) 62===DONE=== 63