reversing a date stamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using the below code as the basis for a client updateable news section..
I have variable called date which is set in the db as TIMESTAMP(6). When I
print it i get the date in the reverse order YYMMDD. What would be the best
way to display it in reverse based on my code below?

Thanks..

<snip>

$result = mysql_query("SELECT * FROM news",$db);
if ($myrow = mysql_fetch_array($result)) {
// display list if there are records to display
do { 
printf("<strong>%s</strong><br>\n", $myrow["title"]);
printf("%s <a href=\"%s?id=%s\" class=\"mailto\">more >></a> [%s]<p>\n",
$myrow["summary"], $_SERVER['PHP_SELF'], $myrow["id"], $myrow["date"]);
} while ($myrow = mysql_fetch_array($result));
} else { 
// no records to display
echo "<p>Sorry, no records were found!";
} 

</snip>
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email       >> mikek@brightstorm.co.uk
Web         >> http://www.brightstorm.co.uk
Tel         >> 0117 9426653 (office)
               07939 252144 (mobile)

Snailmail   >> Unit 8, 14 King Square,
               Bristol BS2 8JJ


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux