testsamedates - 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 testsamedates.php

  1. <?php
  2. $seconds = strtotime("1800-01-01 00:00:00:000000");
  3. $time1 = date_create_from_format("Y-m-d H:i:s:u", "1800-01-01 00:00:00:000000");
  4. $time2 = date_create_from_format("Y-m-d H:i:s:u", "1800-01-01 00:00:00:000000");
  5.  
  6. if ($time1 == $time2) {
  7.     print "same!";
  8. } else {
  9.     print "not!";
  10. }
  11.  
  12. print PHP_EOL;
  13.  
  14. var_dump($time1);
  15. var_dump($time2);
  16.  
File Description
  • testsamedates
  • PHP Code
  • 28 Dec-2020
  • 346 Bytes
You can Share it: