Kamala - Sportingbet - Wordpress Theme - Property in Panama - Myspace Layouts

PDA

View Full Version : Date conversion help.


kks_krishna
Jul 4th 2007, 4:25 pm
HI,

I am getting the date from mysql as "2007-07-04 18:00:55" in this format. While displaying I want to show as "04/07/2007". How can I format like that?

ansi
Jul 4th 2007, 6:46 pm
when you get it from mysql, in your query, let mysql do the dirty work.

select date_format(my_date,'%m/%d/%Y') as date from tbl1

nabil_kadimi
Jul 5th 2007, 10:07 am
use the unix_timestamp function in mysql, it's better IMO

Then in php
strftime("time format",unix_timestamp)