Try something like:

    date_format(news_date, '%d %M %Y @ %H:%I:%S')

Go to http://www.mysql.com/doc/D/a/Date_and_time_functions.html and look for
date_format to determine what parameters to use in order to format the date
as you want it. Note that this method will actually format the date returned
in your SQL statement and does not require any PHP functions, though PHP
will do this to. In most situations I do it using the MySQL function because
it uses one less call to format the date.

[Romans 10:14) How then shall they call on him in whom they have not
believed? and how shall they believe in him of whom they have not heard? and
how shall they hear without a preacher?

----- Original Message -----
From: "Adam Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 05, 2002 8:28 PM
Subject: [PHP-DB] dates in db



i have a date in my mysql database in the format of 20011201 how do I output
that to show for example 01 December 2001 or something similar?

Cheers
Adam




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to