gmdate_variation10.phpt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --TEST--
  2. Test gmdate() function : usage variation - Passing Timezone format options to format argument.
  3. --FILE--
  4. <?php
  5. echo "*** Testing gmdate() : usage variation ***\n";
  6. // Initialise all required variables
  7. date_default_timezone_set('Asia/Calcutta');
  8. $timestamp = mktime(8, 8, 8, 8, 8, 2008);
  9. echo "\n-- Testing gmdate() function with Timezone identifier format --\n";
  10. var_dump( gmdate('e') );
  11. var_dump( gmdate('e', $timestamp) );
  12. echo "\n-- Testing gmdate() function with checking whether date is in daylight saving time format --\n";
  13. var_dump( gmdate('I') );
  14. var_dump( gmdate('I', $timestamp) );
  15. echo "\n-- Testing gmdate() function with difference to GMT in hours format --\n";
  16. var_dump( gmdate('O') );
  17. var_dump( gmdate('O', $timestamp) );
  18. echo "\n-- Testing gmdate() function with Difference to GMT in hours using colon as separator format --\n";
  19. var_dump( gmdate('P') );
  20. var_dump( gmdate('P', $timestamp) );
  21. echo "\n-- Testing gmdate() function with timezone abbreviation format --\n";
  22. var_dump( gmdate('T') );
  23. var_dump( gmdate('T', $timestamp) );
  24. echo "\n-- Testing gmdate() function with timezone offset format --\n";
  25. var_dump( gmdate('T') );
  26. var_dump( gmdate('T', $timestamp) );
  27. ?>
  28. --EXPECTF--
  29. *** Testing gmdate() : usage variation ***
  30. -- Testing gmdate() function with Timezone identifier format --
  31. string(3) "UTC"
  32. string(3) "UTC"
  33. -- Testing gmdate() function with checking whether date is in daylight saving time format --
  34. string(1) "%d"
  35. string(1) "%d"
  36. -- Testing gmdate() function with difference to GMT in hours format --
  37. string(5) "+0000"
  38. string(5) "+0000"
  39. -- Testing gmdate() function with Difference to GMT in hours using colon as separator format --
  40. string(6) "+00:00"
  41. string(6) "+00:00"
  42. -- Testing gmdate() function with timezone abbreviation format --
  43. string(3) "GMT"
  44. string(3) "GMT"
  45. -- Testing gmdate() function with timezone offset format --
  46. string(3) "GMT"
  47. string(3) "GMT"