Forum Moderators: coopster

Message Too Old, No Replies

Converting Database date to normal Date

         

TBozeglav

3:11 am on Aug 17, 2006 (gmt 0)

10+ Year Member



Hi. I am new here and I was wondering if anyone could help me with this problem. I am looking for a way to convert a date that is stored in a MySQL database like this after useing the date() function in PHP:

2006-08-16 21:03:54

and convert it into a date this:

16 August 2006 @ 11:03:54pm

Does anyone have some insight as to how I would go about doing that?

ogletree

3:18 am on Aug 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



type:

php convert date

into google and you will find many examples of how to do it.

ladams02

6:27 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



Here ya go.. just did the same search you are doing yesterday. Used this and it works:


$date = mysql_fetch_row(mysql_query("select date_format('$row[1]', '%e %M %Y @ %l:%i:%s%p')"));

If you need to change how the date looks or what you want to display, use this site as a reference: [dev.mysql.com...]

coopster

3:18 pm on Aug 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Great advice, ladams02. And welcome to WebmasterWorld, TBozeglav.