Hi all, is it possible to format the way now() enters the format of the date and time into the database. It's going in as 2011-01-31 11:03. I want it to ideally be 31-01-2011 11:03. Any help is appreciated as always

guido2004
—
2011-01-31T11:08:29Z —
#2

In doesn't enter that way in the database at all. It's just the way the database shows the value to you.You can change the way it is presented to you using date_format

coxdabd
—
2011-01-31T11:14:41Z —
#3

Hi guido, I've just tried formatting the date as my below example but now nothing is showing...?

<?php echo date_format($orders['date_added'],'%b %d %Y %h:%i %p') ?>

guido2004
—
2011-01-31T11:15:51Z —
#4

date_format is a MySQL function...

coxdabd
—
2011-01-31T11:21:41Z —
#5

Right ok, so I need to use that function when entering data to the database?

logic_earth
—
2011-01-31T11:25:05Z —
#6

coxdabd said:

Right ok, so I need to use that function when entering data to the database?

No, when you pull it out of the database.

coxdabd
—
2011-01-31T11:26:26Z —
#7

Hey dude, could you possibly show me an example of how this is done? Cheers