Hi Richard,

I checked the field type in access and it is a date/time field (it's the only option). However, in access I told it to do a short date format mm/dd/yyyy. Unfortunately it still gives me those extra zero's.


Let's say that getting those zero's is ok. Is this the code that I would write to form the proper date I want?

$dbDate = value from the date field in the database

date("m-d-Y", $dbDate);



Richard Davey wrote:

Hello Gabe,

Friday, April 23, 2004, 7:20:14 PM, you wrote:

G> However, when I retrieve the date from DB using PHP, it displays the
G> following:

G> 2004-04-08 00:00:00

G> Is PHP tacking on the zero's?  I've tried using the date() function to
G> reformat it back to how I want it, but haven't gotten it to work.

You are probably using a datetime field in your database, as opposed
to a date field - which is where the extra zeros are coming from.


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to