Unix timestamps! Problems
Posted: Thu Jun 09, 2005 3:58 pm
I have some unix timestamps in a mysql column named "date".
I am echoeing them using the strtotime() function in order to translate them into a readable date.
However, my dates are all saying December 31, 1969, 6:59 pm
I have checked some of my unix timestamps using converters on the net, and they all read correct dates and times. It seems to only give me this strange date when I echo it.
Really weird.
Any help?
Heres my coding.
I am echoeing them using the strtotime() function in order to translate them into a readable date.
However, my dates are all saying December 31, 1969, 6:59 pm
I have checked some of my unix timestamps using converters on the net, and they all read correct dates and times. It seems to only give me this strange date when I echo it.
Really weird.
Any help?
Heres my coding.
Code: Select all
<?php
$query = "e;SELECT title, content, date FROM news ORDER BY date"e;;
$result = mysql_query($query) or die('Error : ' . mysql_error());
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$title = $rowї'title'];
$content = $rowї'content'];
$date = $rowї'date'];
$date = date("e;F j, Y, g:i a"e;, strtotime($rowї'date']));
echo stripslashes ('<span class="e;date"e;>'.$date.'</span><br><span class="e;title"e;>'.$title.'</span><br><br><span class="e;content"e;>'.$content.'</span><br><br><img src="e;line.jpg"e; width="e;500"e; height="e;10"e;><br><br>'); }
?>