You are here: C97net • 5.03 Date & Time Functions
To calculate number of days between two dates
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
<?php
require './includes/user_init.php';
$d1 = '2010-01-05';
$d2 = '2010-02-01';
echo (diff_date ($d1, $d2)); // 27
?>
There is no comment. Why not be the first?