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("Ymd").' '; ?>
based on 7kFa9
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
19350320 20151130 Ymd
Output for 7.0.6
19350320 20160503 Ymd
Output for 7.0.5
19350320 20160403 Ymd
Output for 7.0.4
19350320 20160310 Ymd
Output for 7.0.3
19350320 20160318 Ymd
Output for 7.0.2
19350320 20160323 Ymd
Output for 7.0.1
19350320 20160324 Ymd
Output for 7.0.0
19350320 20160327 Ymd
Output for 5.6.21
19350320 20160502 Ymd
Output for 5.6.20
19350320 20160410 Ymd
Output for 5.6.19
19350320 20160308 Ymd
Output for 5.6.18
19350320 20160315 Ymd
Output for 5.6.17
19350320 20160320 Ymd
Output for 5.6.16
19350320 20160328 Ymd
Output for 5.6.15
19350320 20160329 Ymd
Output for 5.6.14
19350320 20160402 Ymd
Output for 5.6.13
19350320 20160415 Ymd
Output for 5.6.12
19350320 20160420 Ymd
Output for 5.6.11
19350320 20160424 Ymd
Output for 5.6.10
19350320 20160425 Ymd
Output for 5.6.9
19350320 20160427 Ymd
Output for 5.6.8
19350320 20160430 Ymd
Output for 5.5.35
19350320 20160522 Ymd
Output for 5.5.34
19350320 20160411 Ymd
Output for 5.5.33
19350320 20160309 Ymd
Output for 5.5.32
19350320 20160317 Ymd
Output for 5.5.31
19350320 20160321 Ymd
Output for 5.5.30
19350320 20160401 Ymd
Output for 5.5.29
19350320 20160417 Ymd
Output for 5.5.28
19350320 20160421 Ymd
Output for 5.5.27
19350320 20160422 Ymd
Output for 5.5.26
19350320 20160426 Ymd
Output for 5.5.25
19350320 20160429 Ymd
Output for 5.5.24
19350320 20160524 Ymd