strftime_variation8.phpt 913 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Test strftime() function : usage variation - Passing literal related strings to format argument.
  3. --FILE--
  4. <?php
  5. /* Prototype : string strftime(string format [, int timestamp])
  6. * Description: Format a local time/date according to locale settings
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions:
  9. */
  10. echo "*** Testing strftime() : usage variation ***\n";
  11. // Initialise function arguments not being substituted (if any)
  12. setlocale(LC_ALL, "en_US");
  13. date_default_timezone_set("Asia/Calcutta");
  14. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  15. $format = "%%";
  16. echo "\n-- Testing strftime() function with a literal % character to format --\n";
  17. var_dump( strftime($format) );
  18. var_dump( strftime($format, $timestamp) );
  19. ?>
  20. ===DONE===
  21. --EXPECTF--
  22. *** Testing strftime() : usage variation ***
  23. -- Testing strftime() function with a literal % character to format --
  24. string(1) "%"
  25. string(1) "%"
  26. ===DONE===