Annotation of embedaddon/php/ext/date/tests/gmdate_variation11.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test gmdate() function : usage variation - Passing Full Date/Time format options to format argument.
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string gmdate(string format [, long timestamp])
                      6:  * Description: Format a GMT date/time 
                      7:  * Source code: ext/date/php_date.c
                      8:  * Alias to functions: 
                      9:  */
                     10: 
                     11: echo "*** Testing gmdate() : usage variation ***\n";
                     12: 
                     13: // Initialise all required variables
                     14: date_default_timezone_set('UTC');
                     15: $timestamp = mktime(8, 8, 8, 8, 8, 2008);
                     16: 
                     17: echo "\n-- Testing gmdate() function with ISO 8601 date format --\n";
                     18: var_dump( gmdate('c') );
                     19: var_dump( gmdate('c', $timestamp) );
                     20: 
                     21: echo "\n-- Testing gmdate() function with RFC 2822 date format --\n";
                     22: var_dump( gmdate('r') );
                     23: var_dump( gmdate('r', $timestamp) );
                     24: 
                     25: echo "\n-- Testing gmdate() function with seconds since Unix Epoch format --\n";
                     26: var_dump( gmdate('U') );
                     27: var_dump( gmdate('U', $timestamp) );
                     28: 
                     29: ?>
                     30: ===DONE===
                     31: --EXPECTF--
                     32: *** Testing gmdate() : usage variation ***
                     33: 
                     34: -- Testing gmdate() function with ISO 8601 date format --
                     35: string(%d) "%s"
                     36: string(25) "2008-08-08T08:08:08+00:00"
                     37: 
                     38: -- Testing gmdate() function with RFC 2822 date format --
                     39: string(%d) "%s"
                     40: string(31) "Fri, 08 Aug 2008 08:08:08 +0000"
                     41: 
                     42: -- Testing gmdate() function with seconds since Unix Epoch format --
                     43: string(%d) "%d"
                     44: string(10) "1218182888"
                     45: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>