1--TEST-- 2Test strftime() function : usage variation - Checking Preferred date and time representation on Windows. 3--FILE-- 4<?php 5/* Prototype : string strftime(string format [, int timestamp]) 6 * Description: Format a local time/date according to locale settings 7 * Source code: ext/date/php_date.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing strftime() : usage variation ***\n"; 12 13// Initialise function arguments not being substituted (if any) 14setlocale(LC_ALL, "C"); 15date_default_timezone_set("Asia/Calcutta"); 16$timestamp = mktime(8, 8, 8, 8, 8, 2008); 17 18//array of values to iterate over 19$inputs = array( 20 'Preferred date and time representation' => "%c", 21 'Preferred date representation' => "%x", 22 'Preferred time representation' => "%X", 23); 24 25// loop through each element of the array for timestamp 26 27foreach($inputs as $key =>$value) { 28 echo "\n--$key--\n"; 29 var_dump( strftime($value) ); 30 var_dump( strftime($value, $timestamp) ); 31} 32 33?> 34===DONE=== 35--EXPECTF-- 36*** Testing strftime() : usage variation *** 37 38--Preferred date and time representation-- 39string(%d) "%s %s %d %d:%d:%d %d" 40string(24) "Fri Aug 8 08:08:08 2008" 41 42--Preferred date representation-- 43string(%d) "%d/%d/%d" 44string(8) "08/08/08" 45 46--Preferred time representation-- 47string(%d) "%d:%d:%d" 48string(8) "08:08:08" 49===DONE=== 50