3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo "Now: ", $now = strtotime("now"), "\n"; echo "2 years ago: ", $then = strtotime("now -2 years"), "\n"; echo "6 years ago: ", $now2 = strtotime("now -6 years"), "\n"; echo "8 years ago: ", $then2 = strtotime("now -8 years"), "\n"; echo "Dif 1: ", $dif1 = ($now-$then) / 60 / 60, " hours\n"; echo "Dif 2: ", $dif2 = ($now2-$then2) / 60 / 60, " hours\n"; echo "Two years simple: ", $simple = 2*365*24, " hours\n"; echo "Dif1 to dif2 ", $dif2 - $dif1, " hours\n"; echo "Dif1 to simple ", $dif1 - $simple, " hours\n";
based on EKAcS
Output for 5.6.28, 7.0.20 - 7.2.0
Now: 1453305256 2 years ago: 1390233256 6 years ago: 1264002856 8 years ago: 1200844456 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 7.0.6
Now: 1463832332 2 years ago: 1400673932 6 years ago: 1274443532 8 years ago: 1211371532 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 7.0.5
Now: 1459670386 2 years ago: 1396511986 6 years ago: 1270281586 8 years ago: 1207209586 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 7.0.4
Now: 1457644071 2 years ago: 1394485671 6 years ago: 1268255271 8 years ago: 1205183271 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 7.0.3
Now: 1458340980 2 years ago: 1395182580 6 years ago: 1268952180 8 years ago: 1205880180 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 7.0.2
Now: 1458708628 2 years ago: 1395550228 6 years ago: 1269319828 8 years ago: 1206247828 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 7.0.1
Now: 1458805943 2 years ago: 1395647543 6 years ago: 1269417143 8 years ago: 1206345143 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 7.0.0
Now: 1459068317 2 years ago: 1395913517 6 years ago: 1269683117 8 years ago: 1206611117 Dif 1: 17543 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -23 hours Dif1 to simple 23 hours
Output for 5.6.21
Now: 1462200885 2 years ago: 1399042485 6 years ago: 1272812085 8 years ago: 1209740085 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.20
Now: 1460271736 2 years ago: 1397113336 6 years ago: 1270882936 8 years ago: 1207810936 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.19
Now: 1457414270 2 years ago: 1394255870 6 years ago: 1268025470 8 years ago: 1204953470 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.18
Now: 1458051428 2 years ago: 1394893028 6 years ago: 1268662628 8 years ago: 1205590628 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.17
Now: 1458438563 2 years ago: 1395280163 6 years ago: 1269049763 8 years ago: 1205977763 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.16
Now: 1459157702 2 years ago: 1396002902 6 years ago: 1269768902 8 years ago: 1206700502 Dif 1: 17543 hours Dif 2: 17519 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 23 hours
Output for 5.6.15
Now: 1459247094 2 years ago: 1396092294 6 years ago: 1269858294 8 years ago: 1206789894 Dif 1: 17543 hours Dif 2: 17519 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 23 hours
Output for 5.6.14
Now: 1460650047 2 years ago: 1397491647 6 years ago: 1271261247 8 years ago: 1208189247 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.13
Now: 1460738797 2 years ago: 1397580397 6 years ago: 1271349997 8 years ago: 1208277997 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.12
Now: 1461136630 2 years ago: 1397978230 6 years ago: 1271747830 8 years ago: 1208675830 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.11
Now: 1461505382 2 years ago: 1398346982 6 years ago: 1272116582 8 years ago: 1209044582 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.10
Now: 1461599320 2 years ago: 1398440920 6 years ago: 1272210520 8 years ago: 1209138520 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.9
Now: 1461791822 2 years ago: 1398633422 6 years ago: 1272403022 8 years ago: 1209331022 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.6.8
Now: 1461994971 2 years ago: 1398836571 6 years ago: 1272606171 8 years ago: 1209534171 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.35
Now: 1463965238 2 years ago: 1400806838 6 years ago: 1274576438 8 years ago: 1211504438 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.34
Now: 1460366225 2 years ago: 1397207825 6 years ago: 1270977425 8 years ago: 1207905425 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.33
Now: 1457511784 2 years ago: 1394353384 6 years ago: 1268122984 8 years ago: 1205050984 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.32
Now: 1458238586 2 years ago: 1395080186 6 years ago: 1268849786 8 years ago: 1205777786 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.31
Now: 1458536610 2 years ago: 1395378210 6 years ago: 1269147810 8 years ago: 1206075810 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.30
Now: 1459512959 2 years ago: 1396354559 6 years ago: 1270124159 8 years ago: 1207052159 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.29
Now: 1460876646 2 years ago: 1397718246 6 years ago: 1271487846 8 years ago: 1208415846 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.28
Now: 1461234996 2 years ago: 1398076596 6 years ago: 1271846196 8 years ago: 1208774196 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.27
Now: 1461327228 2 years ago: 1398168828 6 years ago: 1271938428 8 years ago: 1208866428 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.26
Now: 1461695414 2 years ago: 1398537014 6 years ago: 1272306614 8 years ago: 1209234614 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.25
Now: 1461895030 2 years ago: 1398736630 6 years ago: 1272506230 8 years ago: 1209434230 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.5.24
Now: 1464078530 2 years ago: 1400920130 6 years ago: 1274689730 8 years ago: 1211617730 Dif 1: 17544 hours Dif 2: 17520 hours Two years simple: 17520 hours Dif1 to dif2 -24 hours Dif1 to simple 24 hours
Output for 5.4.45
Now: 1453305259 2 years ago: 1390233259 6 years ago: 1264002859 8 years ago: 1200844459 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.44
Now: 1453305260 2 years ago: 1390233260 6 years ago: 1264002860 8 years ago: 1200844460 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.42 - 5.4.43
Now: 1453305261 2 years ago: 1390233261 6 years ago: 1264002861 8 years ago: 1200844461 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.41
Now: 1453305262 2 years ago: 1390233262 6 years ago: 1264002862 8 years ago: 1200844462 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.39 - 5.4.40
Now: 1453305263 2 years ago: 1390233263 6 years ago: 1264002863 8 years ago: 1200844463 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.37 - 5.4.38
Now: 1453305264 2 years ago: 1390233264 6 years ago: 1264002864 8 years ago: 1200844464 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.34 - 5.4.36
Now: 1453305265 2 years ago: 1390233265 6 years ago: 1264002865 8 years ago: 1200844465 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.3.29, 5.4.32
Now: 1453305266 2 years ago: 1390233266 6 years ago: 1264002866 8 years ago: 1200844466 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.28 - 5.4.31
Now: 1453305267 2 years ago: 1390233267 6 years ago: 1264002867 8 years ago: 1200844467 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.25 - 5.4.27
Now: 1453305268 2 years ago: 1390233268 6 years ago: 1264002868 8 years ago: 1200844468 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.3.28, 5.4.21 - 5.4.24
Now: 1453305269 2 years ago: 1390233269 6 years ago: 1264002869 8 years ago: 1200844469 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.4.18 - 5.4.20
Now: 1453305270 2 years ago: 1390233270 6 years ago: 1264002870 8 years ago: 1200844470 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.3.24 - 5.3.27, 5.4.14 - 5.4.17
Now: 1453305271 2 years ago: 1390233271 6 years ago: 1264002871 8 years ago: 1200844471 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours
Output for 5.3.22 - 5.3.23, 5.4.12 - 5.4.13
Now: 1453305272 2 years ago: 1390233272 6 years ago: 1264002872 8 years ago: 1200844472 Dif 1: 17520 hours Dif 2: 17544 hours Two years simple: 17520 hours Dif1 to dif2 24 hours Dif1 to simple 0 hours