if the date is in datetime format such as 01/01/2009 14:06:56 .php code to how can we get the time as well as date difference between the two dates as date1=01/01/2009 14:06:56 and date2=01/01/2009 15:26:56 .
please give me reply.
if the date is in datetime format such as 01/01/2009 14:06:56 .php code to how can we get the time as well as date difference between the two dates as date1=01/01/2009 14:06:56 and date2=01/01/2009 15:26:56 .
please give me reply.
$d1 = new DateTime("today");
$d2 = new DateTime("tomorrow");
echo $d2->format('U') - $d1->format('U') . "\n";
I'm no PHP expert, but looking around perhaps the code listed above should return the no. of seconds between today and tomorrow...
Also, see this post for a function that does date/time calculation.
You must log in to post.