mkdate and getdate - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of mkdate and getdate.php

  1. <?php
  2. $expires = mktime(13, 30, 0, 3, 15, 2018);
  3. echo($expires . "<br>");
  4. $parts = getdate($expires);
  5. $year = $parts['year'];
  6. echo($year . "<br>");
  7. $mon = $parts['mon'];
  8. echo($mon . "<br>");
  9. $month = $parts['month'];
  10. echo($month . "<br>");
  11. $mday = $parts['mday'];
  12. echo($mday . "<br>");
  13. $weekday = $parts['weekday'];
  14. echo($weekday . "<br>");
  15. $wday = $parts['wday'];
  16. echo($wday . "<br>");
  17. $hours = $parts['hours'];
  18. echo($hours . "<br>");
  19. $minutes = $parts['minutes'];
  20. echo($minutes . "<br>");
  21. $seconds = $parts['seconds'];
  22. echo($seconds . "<br>");
  23.  
  24.  
File Description
  • mkdate and getdate
  • PHP Code
  • 06 Apr-2021
  • 547 Bytes
You can Share it: