Re: PHP modifying data from DB?

From: Date: Fri, 23 Apr 2004 18:33:53 +0000
Subject: Re: PHP modifying data from DB?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-184451@lists.php.net to get a copy of this message
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.


« previous php.general (#184451) next »