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

  1. <?php
  2. $time1 = date_create_from_format("Y-m-d H:i:s.u", "2000-01-01 00:00:00.000");
  3. $time2 = date_create_from_format("Y-m-d H:i:s.u", "2000-01-01 00:00:00.000");
  4.  
  5. if ($time1 == $time2) {
  6.     print "== same!";
  7. } else {
  8.     print "== not!";
  9. }
  10.  
  11. print PHP_EOL;
  12.  
  13. if ($time1 === $time2) {
  14.     print "=== same!";
  15. } else {
  16.     print "=== not!";
  17. }
  18.  
  19. print PHP_EOL;
  20.  
  21. var_dump($time1);
  22. var_dump($time2);
  23.  
File Description
  • datetest2
  • PHP Code
  • 28 Dec-2020
  • 392 Bytes
You can Share it: