Forum Moderators: coopster
<?php
mysql_connect('localhost', 'x', 'x');
mysql_select_db('x');
$query = mysql_query('SELECT * FROM `pub_news` ORDER BY `date` DESC');
while ($row = mysql_fetch_array($query))
{
echo date("nS F Y", $row[date])."<br>";
}
?>
The two database values for the 'date' field are '1178364600' (5th May 2007) and '1178896085' (11th May 2007). The code outputs the correct values for the fields as $row[date], but date() displays both as 5th May 2007.
I have checked the server time and although it's a few minutes fast, it seems OK. Am I being really stupid and missing something obvious?