$sql = "SELECT * FROM news ORDER BY `news_id` DESC LIMIT 1";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
$date = $row['time_posted'];
echo "<i> " .date("Y/m/d", $date) . "</i>: ";
我在mysql中使用了timestamp。date()显示1969年12月
'time_posted'的字段类型是什么?在把它扔到'日期'函数之前,你甚至检查过它的值吗? – zneak 2010-04-26 01:29:54
@zneak'timestamp' – Strawberry 2010-04-26 01:36:54