<分区>
Possible Duplicate:
How to calculate the difference between two dates using PHP?
How to find number of days between two dates using php
How to find the dates between two specified date?
我的表中有三个字段
seeker
name ....current_time.... login_date
second field i have created through timestamp phpmyadmin
type: timestamp
default: current_timestamp
当搜索者注册时,他的 current_time 会自动按时间戳插入
third field is login_date filed. when user logins then this field is updated
//login date
$login_date = date("Y-m-d");
echo "login date"."".$login_date;
$qry1 = "update seeker set login_date = '$login_date' where name='$uname'";
$res1=mysql_query($qry1,$con);
now current_date is like
"2012-04-10 21:58:01"
and login_date is like
"2012-05-02"
我想找出这两个日期之间的天数。我不知道如何减去这些日期,因为 current_date 也包含时间。或者是否有任何其他方法可以从当前日期中排除时间,即它只输入日期而不输入时间