gmdate_variation5.phpt 776 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Test gmdate() function : usage variation - Passing Week representation to format.
  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. echo "*** Testing gmdate() : usage variation ***\n";
  11. // Initialise all required variables
  12. date_default_timezone_set('UTC');
  13. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  14. echo "\n-- Testing gmdate() function with ISO-8601 week number of year format --\n";
  15. var_dump( gmdate('W') );
  16. var_dump( gmdate('W', $timestamp) );
  17. ?>
  18. ===DONE===
  19. --EXPECTF--
  20. *** Testing gmdate() : usage variation ***
  21. -- Testing gmdate() function with ISO-8601 week number of year format --
  22. string(%d) "%d"
  23. string(2) "32"
  24. ===DONE===