getdate_basic.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. --TEST--
  2. Test getdate() function : basic functionality
  3. --FILE--
  4. <?php
  5. echo "*** Testing getdate() : basic functionality ***\n";
  6. //Set the default time zone
  7. date_default_timezone_set("Asia/Calcutta");
  8. // Initialise all required variables
  9. $timestamp = 10;
  10. // Calling getdate() with all possible arguments
  11. var_dump( getdate($timestamp) );
  12. // Calling getdate() with mandatory arguments
  13. var_dump( getdate() );
  14. ?>
  15. --EXPECTF--
  16. *** Testing getdate() : basic functionality ***
  17. array(11) {
  18. ["seconds"]=>
  19. int(10)
  20. ["minutes"]=>
  21. int(30)
  22. ["hours"]=>
  23. int(5)
  24. ["mday"]=>
  25. int(1)
  26. ["wday"]=>
  27. int(4)
  28. ["mon"]=>
  29. int(1)
  30. ["year"]=>
  31. int(1970)
  32. ["yday"]=>
  33. int(0)
  34. ["weekday"]=>
  35. string(8) "Thursday"
  36. ["month"]=>
  37. string(7) "January"
  38. [0]=>
  39. int(10)
  40. }
  41. array(11) {
  42. ["seconds"]=>
  43. int(%d)
  44. ["minutes"]=>
  45. int(%d)
  46. ["hours"]=>
  47. int(%d)
  48. ["mday"]=>
  49. int(%d)
  50. ["wday"]=>
  51. int(%d)
  52. ["mon"]=>
  53. int(%d)
  54. ["year"]=>
  55. int(%d)
  56. ["yday"]=>
  57. int(%d)
  58. ["weekday"]=>
  59. string(%d) %s
  60. ["month"]=>
  61. string(%d) %s
  62. [0]=>
  63. int(%d)
  64. }