Annotation of embedaddon/php/ext/date/tests/strftime_variation7.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test strftime() function : usage variation - Passing day related format strings to format argument.
! 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:
! 11: echo "*** Testing strftime() : usage variation ***\n";
! 12:
! 13: // Initialise function arguments not being substituted (if any)
! 14: setlocale(LC_ALL, "en_US");
! 15: date_default_timezone_set("Asia/Calcutta");
! 16: $timestamp = mktime(18, 8, 8, 8, 8, 2008);
! 17:
! 18:
! 19: //array of values to iterate over
! 20: $inputs = array(
! 21: 'Day of the month as a decimal number' => "%d",
! 22: 'Day of the year as a decimal number' => "%j",
! 23: 'Day of the week as a decimal number' => "%w"
! 24: );
! 25:
! 26: // loop through each element of the array for timestamp
! 27:
! 28: foreach($inputs as $key =>$value) {
! 29: echo "\n--$key--\n";
! 30: var_dump( strftime($value) );
! 31: var_dump( strftime($value, $timestamp) );
! 32: };
! 33:
! 34: ?>
! 35: ===DONE===
! 36: --EXPECTF--
! 37: *** Testing strftime() : usage variation ***
! 38:
! 39: --Day of the month as a decimal number--
! 40: string(%d) "%d"
! 41: string(2) "08"
! 42:
! 43: --Day of the year as a decimal number--
! 44: string(%d) "%d"
! 45: string(3) "221"
! 46:
! 47: --Day of the week as a decimal number--
! 48: string(%d) "%d"
! 49: string(1) "5"
! 50: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>