Annotation of embedaddon/php/ext/date/tests/idate_variation5.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test 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:
! 11: echo "*** Testing idate() : usage variation ***\n";
! 12:
! 13: // Initialise function arguments not being substituted (if any)
! 14: date_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
! 30: foreach($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--
! 40: int(%d)
! 41:
! 42: --12 hour format--
! 43: int(%d)
! 44:
! 45: --24 hour format--
! 46: int(%d)
! 47:
! 48: --Minutes--
! 49: int(%d)
! 50:
! 51: --DST Activated--
! 52: int(%d)
! 53:
! 54: --Seconds--
! 55: int(%d)
! 56:
! 57: --Seconds since Unix Epoch--
! 58: int(%d)
! 59:
! 60: --Time zone offset--
! 61: int(%d)
! 62: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>