gmdate_basic.phpt 738 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Test gmdate() function : basic functionality
  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() : basic functionality ***\n";
  11. // Initialise all required variables
  12. date_default_timezone_set('UTC');
  13. $format = DATE_ISO8601;
  14. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  15. // Calling gmdate() with all possible arguments
  16. var_dump( gmdate($format, $timestamp) );
  17. // Calling gmdate() with mandatory arguments
  18. var_dump( gmdate($format) );
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. *** Testing gmdate() : basic functionality ***
  23. string(24) "2008-08-08T08:08:08+0000"
  24. string(%d) "%s"
  25. ===DONE===