Reputation: 1
how to subtract two dates and value will be stored as interger,
like
int a=returndate - issuedate;
here (a) will be number of days.
like
int a=24-12-2010 - 12-12-2010;
here a is 12;
Upvotes: 0
Views: 413
Reputation: 3785
use timestamp
for this
$a=strtotime(24-12-2010) - strtotime(12-12-2010);
date('m',$a);//gives number of days
for mysql use DATEDIFF
Upvotes: 1