gmstrftime_basic.phpt 788 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Test gmstrftime() function : basic functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : string gmstrftime(string format [, int timestamp])
  6. * Description: Format a GMT/UCT time/date according to locale settings
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing gmstrftime() : basic functionality ***\n";
  11. // Initialise all required variables
  12. $format = '%b %d %Y %H:%M:%S';
  13. $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
  14. // Calling gmstrftime() with all possible arguments
  15. var_dump( gmstrftime($format, $timestamp) );
  16. // Calling gmstrftime() with mandatory arguments
  17. var_dump( gmstrftime($format) );
  18. ?>
  19. ===DONE===
  20. --EXPECTF--
  21. *** Testing gmstrftime() : basic functionality ***
  22. string(20) "Aug 08 2008 08:08:08"
  23. string(%d) "%s %d %d %d:%d:%d"
  24. ===DONE===