strftime_basic.phpt 812 B

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