Forum Moderators: coopster

Message Too Old, No Replies

PHP date Conversion

PHP date Conversion

         

PumpkinHead

1:46 pm on Mar 23, 2004 (gmt 0)

10+ Year Member



Hi, Could someone please help!

I have stored the date in my database as YYYY-MM-DD (E.g 2004-03-23) format and I need to convert this to a user friendly format (E.g "23rd March, 2004")...How would I go about this?

Also, what is the best field type in a MySQL database for holding news text as the current field I am using (VarChar) is limited to 255.

Maybe I should just scrap the whole database and start again?!

Thanks

dcrombie

1:59 pm on Mar 23, 2004 (gmt 0)



To convert dates to something friendlier:

$newdate = date ("jS F, Y", strtotime ($olddate));

I use mediumtext for news item text but there are a lot of options - you should read the MySQL manual on data types.

jamesa

3:31 pm on Mar 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>> (VarChar) is limited to 255

Text type [mysql.com] would be the way to go.

PumpkinHead

5:02 pm on Mar 23, 2004 (gmt 0)

10+ Year Member



Great thanks for that peeps