diff_date ()

function diff_date ($sql_date1, $sql_date2 = 'now')

Use this function to calculate number of days between two dates, $sql_date1 & $sql_date2.

$sql_date1 = the first date

$sql_date2 = the second date, you can also use 'now' to use current date.

Example 1

require './includes/user_init.php';

$d1 = '2010-01-05';
$d2 = '2010-02-01';
echo (diff_date ($d1, $d2)); // 27

Posted On: Aug-23-2010 @ 07:00am
Last Updated: Jan-01-1970 @ 07:00am

There is no comment. Why not be the first?

More Comments/Post Your Own