Re: [PHP] Formatting timestamp date in MySQL

2002-04-09 Thread Alex
Hello, I just started with php and I'm also trying to format mysql date -mm-dd into mm/dd/. I looked through some books and they describe the use of DATE_FORMAT to covert the dates. Is there any other way to format the date? Thanks Alex My script looks like this: $month_1 = ($date_mon

Re: [PHP] Formatting timestamp date in MySQL

2002-04-09 Thread Justin French
There is a difference between MySQL's timestamp, and a UNIX timestamp. strtotime(); is a really valuable tool -- converting almost any English date description -- check out the manual for more info. Anyway, in this case, it is able to convert your MySQL date of 20020409 into a unix timestamp, wh

Re: [PHP] Formatting timestamp date in MySQL

2002-04-09 Thread ayukawa
Hello, >The column is set as "date timestamp(8)". >A sample of date is "20020409" > >I use the PHP Date function to format it back to say "9th April 2002". >$date_formated = date($date, 'S M Y' ); How about this; $date_formatted=date("jS M Y",mktime(0,0,0,substr($date,4,2),substr ($date,6,2),su