3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $joinDate = '2014-04-22 10:36:33'; $today = date('Y-m-d H:i:s'); $Mdate1 = strtotime($joinDate); $Mdate2 = strtotime($today); $months = '0'; while (strtotime('+1 MONTH', $Mdate1) < $Mdate2) { $months++; $Mdate1 = strtotime('+1 MONTH', $Mdate1); } $Mweeks = abs(strtotime($Mdate1) - strtotime($Mdate2)) / 604800; echo $months; echo "<br>"; echo $Mweeks; ?>
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0<br>0
Output for 4.3.0 - 5.0.5
0<br>1486.5654761905