如何计算PHP中两个日期之间的日期?
问题描述:
我需要计算从数据库获取的日期和当前日期之间的天数。
I need to calculate days between a date I get from the database and the current date.
$upload_date = mysql_query("SELECT Date FROM Setting WHERE ID = $row[ID]");
$current_date = date("Y-m-d");
我该怎么做?
答
select datediff(curdate(),'2011-03-01');