Last active
December 21, 2015 04:19
-
-
Save boy3vil/6249093 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$date1=date('2011-1-1'); | |
$date2=date('2011-5-2'); | |
echo "date1 :: ".$date1."<br>"; | |
echo "date2 :: ".$date2."<br>"; | |
$date_diff=strtotime($date2)-strtotime($date1); | |
echo "date difference in months => ".floor(($date_diff)/2628000)." months <br>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment