fork download
  1. <?php
  2.  
  3. $today = new DateTime();
  4. $date = new DateTime('2019.11.10');
  5.  
  6. $interval = $today->diff($date);
  7. echo $interval->format("%r%a");
  8.  
Runtime error #stdin #stdout #stderr 0.02s 24756KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Fatal error:  Uncaught Exception: DateTime::__construct(): Failed to parse time string (2019.11.10) at position 5 (1): Double time specification in /home/JoZgfc/prog.php:4
Stack trace:
#0 /home/JoZgfc/prog.php(4): DateTime->__construct('2019.11.10')
#1 {main}
  thrown in /home/JoZgfc/prog.php on line 4