3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fileDate = DateTime::createFromFormat("Ymd", "19350320"); $now = new DateTime("now"); echo $fileDate->format("Ymd").' '; echo $now->format("Ymd").' '; $diff1 = $now->diff($fileDate, true); echo $diff1->format("%d days"); ?>
based on QuaLb
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
19350320 20151130 9 days
Output for 7.0.6
19350320 20160503 13 days
Output for 7.0.5
19350320 20160403 13 days
Output for 7.0.4
19350320 20160310 20 days
Output for 7.0.3
19350320 20160318 28 days
Output for 7.0.2
19350320 20160323 2 days
Output for 7.0.1
19350320 20160324 3 days
Output for 7.0.0
19350320 20160327 6 days
Output for 5.6.21
19350320 20160502 12 days
Output for 5.6.20
19350320 20160410 20 days
Output for 5.6.19
19350320 20160308 18 days
Output for 5.6.18
19350320 20160315 25 days
Output for 5.6.17
19350320 20160320 30 days
Output for 5.6.16
19350320 20160328 7 days
Output for 5.6.15
19350320 20160329 8 days
Output for 5.6.14
19350320 20160402 12 days
Output for 5.6.13
19350320 20160415 25 days
Output for 5.6.12
19350320 20160420 30 days
Output for 5.6.11
19350320 20160424 3 days
Output for 5.6.10
19350320 20160425 4 days
Output for 5.6.9
19350320 20160427 6 days
Output for 5.6.8
19350320 20160430 9 days
Output for 5.5.35
19350320 20160522 1 days
Output for 5.5.34
19350320 20160411 21 days
Output for 5.5.33
19350320 20160309 19 days
Output for 5.5.32
19350320 20160317 27 days
Output for 5.5.31
19350320 20160321 0 days
Output for 5.5.30
19350320 20160401 11 days
Output for 5.5.29
19350320 20160417 27 days
Output for 5.5.28
19350320 20160421 0 days
Output for 5.5.27
19350320 20160422 1 days
Output for 5.5.26
19350320 20160426 5 days
Output for 5.5.25
19350320 20160429 8 days
Output for 5.5.24
19350320 20160524 3 days