Get Difference Between 2 Dates Using PHP
Filed Under (General) by Wenbert on 29-01-2008
Tagged Under : PHP
Here is how you get the number of days between two dates.
function getdays($day1,$day2) { return round((strtotime($day2)-strtotime($day1))/(24*60*60),0); } $begin = date("Y-m-d"); // we set today as an example $end = "2007-01-29"; echo getdays($begin,$end).' days';
This was taken from the manual - posted by: michiel at mb-it dot nl
Related posts:
- Get Difference Between 2 Dates Using PHP Here is how to get the difference between two dates...
- Get number of hours between 2 timezones Here is a way to get the number of hours...
- PHP.net updates the Manual PHP.net has probably the best manual in world. All manuals...
- How to get the a date before current date in PHP Given 2008-01-31 as the current date and the value of...
- Cron job examples for newbies Here are a few examples from this site. 01 *...
Related posts brought to you by Yet Another Related Posts Plugin.
