View Single Post
  #3 (permalink)  
Old 2007-10-22, 08:48 AM
celon_php_master celon_php_master is offline
Junior Member
 
Join Date: Oct 2007
Posts: 23
celon_php_master is on a distinguished road
Default

it is easy

let say ur database table date filed is in the timestamp fromat

$Today_date=date("Y-m-d");

$D1=substr($table_date_field,0,8);
$D2=substr($Today_date,0,8);

$Date_str_one=strtotime($D1);
$Date_str_two=strtotime($D2);
$no_of_dayz= ($Date_str_two-$Date_str_one)/(3600*24);
Reply With Quote