3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fileDate = DateTime::createFromFormat("Ymd", "20500320"); $now = new DateTime("now"); echo $fileDate->format("Ymd").' '; echo $now->format("Ymd").' '; $diff1 = $now->diff($fileDate, true); echo $diff1->format("%y years"); ?>
based on ApCKX
Output for 5.3.20 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
20500320 20151130 34 years
Output for 7.0.6
20500320 20160503 33 years
Output for 7.0.5
20500320 20160403 33 years
Output for 7.0.4
20500320 20160310 34 years
Output for 7.0.3
20500320 20160318 34 years
Output for 7.0.2
20500320 20160323 33 years
Output for 7.0.1
20500320 20160324 33 years
Output for 7.0.0
20500320 20160327 33 years
Output for 5.6.21
20500320 20160502 33 years
Output for 5.6.20
20500320 20160410 33 years
Output for 5.6.19
20500320 20160308 34 years
Output for 5.6.18
20500320 20160315 34 years
Output for 5.6.17
20500320 20160320 34 years
Output for 5.6.16
20500320 20160328 33 years
Output for 5.6.15
20500320 20160329 33 years
Output for 5.6.14
20500320 20160402 33 years
Output for 5.6.13
20500320 20160415 33 years
Output for 5.6.12
20500320 20160420 33 years
Output for 5.6.11
20500320 20160424 33 years
Output for 5.6.10
20500320 20160425 33 years
Output for 5.6.9
20500320 20160427 33 years
Output for 5.6.8
20500320 20160430 33 years
Output for 5.5.35
20500320 20160522 33 years
Output for 5.5.34
20500320 20160411 33 years
Output for 5.5.33
20500320 20160309 34 years
Output for 5.5.32
20500320 20160317 34 years
Output for 5.5.31
20500320 20160321 33 years
Output for 5.5.30
20500320 20160401 33 years
Output for 5.5.29
20500320 20160417 33 years
Output for 5.5.28
20500320 20160421 33 years
Output for 5.5.27
20500320 20160422 33 years
Output for 5.5.26
20500320 20160426 33 years
Output for 5.5.25
20500320 20160429 33 years
Output for 5.5.24
20500320 20160524 33 years