1--TEST-- 2Test strftime() function : usage variation - Checking time related formats which was not supported on Windows before VC14. 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 'Time in a.m/p.m notation' => "%r", 21 'Time in 24 hour notation' => "%R", 22 'Current time %H:%M:%S format' => "%T", 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--Time in a.m/p.m notation-- 39string(%d) "%d:%d:%d %s" 40string(11) "08:08:08 AM" 41 42--Time in 24 hour notation-- 43string(%d) "%d:%d" 44string(5) "08:08" 45 46--Current time %H:%M:%S format-- 47string(%d) "%d:%d:%d" 48string(8) "08:08:08" 49===DONE=== 50