Convert SYSDATE() into something more viewable
Posted: Wed Jun 04, 2008 3:27 pm
Hi there,
Can anyone tell me how I convert the SYSDATE() format 2008-06-04 21:10:01
into something more viewable like:
04/06/2008 21:10:01
in php?
I am requesting this from the DB in a loop but I need to view "$row["logged"] " as 04/06/2008 21:10:01
<?
$result = mysql_query("SELECT topic, logged FROM forum order by logged desc");
if (!$result) {
echo("<P>Error performing query: " . mysql_error() . "</P>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
echo("<tr><td> </td><td>" . $row["topic"] . "</td><td>" . $row["logged"] . "</td></tr>");
}
?>
Can anyone tell me how I convert the SYSDATE() format 2008-06-04 21:10:01
into something more viewable like:
04/06/2008 21:10:01
in php?
I am requesting this from the DB in a loop but I need to view "$row["logged"] " as 04/06/2008 21:10:01
<?
$result = mysql_query("SELECT topic, logged FROM forum order by logged desc");
if (!$result) {
echo("<P>Error performing query: " . mysql_error() . "</P>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
echo("<tr><td> </td><td>" . $row["topic"] . "</td><td>" . $row["logged"] . "</td></tr>");
}
?>