当我加载数据库值时:
<?=$list[time]?>
在chrome中输出为:2013-10-07T14:27:56 在firefox中,输出是:0000-00-00 00:00:00
这怎么可能?
$list[time]
是数据库中的时间戳值。
我的代码:
$lsel_list = mysql_query("select * from users WHERE id = '$id' order by id asc");
while ($list = mysql_fetch_array($lsel_list)) {
echo"$list[time]";
}
字段时间是数据库中带有时间的时间戳。 (2013-10-07 14:28:35)
答案 0 :(得分:0)
Try this :
echo date("Y m d",strtotime($list[time]));