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

<?php
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

Advertisement

Latest Comments

  • martynripley89 on Security Issues with qEngine Family
    “cyberSecure” - Jun 27
  • Guest on Forum
    “re:BB code or html in item_details” - Jun 26
  • Guest on Forum
    “BB code or html in item_details” - Jun 26
  • Guest on Forum
    “noFollow links.” - Jun 19
  • username on Forum
    “Sponsor or Premium user” - Jun 14

Most Commented

Online Users

There are 126 users online.

Connect

Connect with us on Facebook

Newsletter

Subscribe to our newsletter for the latest updates and exciting promotions!