View Single Post
Old 04-01-2006, 02:49 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,529
sde is on a distinguished road
there is a mysql function called unix_timestamp() that will return the date in that format. then you can use PHP's date() function to format it how you did in the other part of your code.

example:
PHP Code:
<?
$result 
mysql_query("select unix_timestamp(article_date) as date from mytable where article_id='1'");

if (
$row mysql_fetch_assoc($result)) {
  
$date date('F d, Y, h:i:s A'$row['date']);
}
?>
here's something i wrote a long time ago. same thing, different example
http://php.codenewbie.com/articles/p...mp-Page_1.html
sde is offline   Reply With Quote