Created
June 20, 2018 11:58
-
-
Save robozavri/b486226c4851187ced1c48dc430e03b3 to your computer and use it in GitHub Desktop.
php datatime different
This file contains hidden or 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
$start_date = new DateTime('2007-09-01 04:10:58'); | |
$since_start = $start_date->diff(new DateTime('2012-09-11 10:25:00')); | |
echo $since_start->days.' days total<br>'; | |
echo $since_start->y.' years<br>'; | |
echo $since_start->m.' months<br>'; | |
echo $since_start->d.' days<br>'; | |
echo $since_start->h.' hours<br>'; | |
echo $since_start->i.' minutes<br>'; | |
echo $since_start->s.' seconds<br>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment