Results 1 to 2 of 2

Thread: Date Difference

  1. #1
    Join Date
    Nov 2011
    Posts
    9

    Date Difference

    I have made a table in mysql, and one of the member of this table is "in_date" which I have assigned it as "DATE".

    Now, I want to calculate remaining days of "today" and "in_date".

    <?php

    $remaining_date = $today - $in_date;

    echo $remaining_date;

    ?>

    I want to display "days" but it does not work!

  2. #2
    Join Date
    Apr 2012
    Posts
    7
    Try to do it inside MySQL:

    SELECT DATEDIFF(<name of date column>, NOW()) AS difference_in_days;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •