简体   繁体   中英

2 Different outputs (Chrome and IE/FIREFOX)

When i load the database value like this:

<?=$list[time]?>  

In chrome the output is: 2013-10-07T14:27:56 In firefox the output is: 0000-00-00 00:00:00

How is this possible?? $list[time] is a timestamp value in the database.

MY CODE:

$lsel_list = mysql_query("select * from users WHERE id = '$id' order by id asc");
while ($list = mysql_fetch_array($lsel_list)) { 
  echo"$list[time]";
} 

field time is timestamp in database with a time. (2013-10-07 14:28:35)

Try this :
echo date("Y m d",strtotime($list[time]));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM