Annotation of embedaddon/php/ext/date/tests/idate_variation6.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test idate() function : usage variation - Checking return of year(1 or 2 digits) format starting with zero and nonzero.
! 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: $format = 'y';
! 16:
! 17: echo "\n-- Testing idate() function for 2 digit year having no zero as starting number --\n";
! 18: $timestamp = mktime(8, 8, 8, 8, 8, 1970);
! 19: var_dump( idate($format, $timestamp) );
! 20:
! 21: echo "\n-- Testing idate() function for 2 digit year having zero as starting number --\n";
! 22: $timestamp = mktime(8, 8, 8, 8, 8, 2001);
! 23: var_dump( idate($format, $timestamp) );
! 24: ?>
! 25: ===DONE===
! 26: --EXPECTF--
! 27: *** Testing idate() : usage variation ***
! 28:
! 29: -- Testing idate() function for 2 digit year having no zero as starting number --
! 30: int(70)
! 31:
! 32: -- Testing idate() function for 2 digit year having zero as starting number --
! 33: int(1)
! 34: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>