Re: PHP modifying data from DB?
| From: | Gabe | Date: | Mon, 26 Apr 2004 13:43:07 +0000 |
| Subject: | Re: PHP modifying data from DB? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184635@lists.php.net to get a copy of this message | ||
Chris Shiflett wrote:
--- Gabe <ydnahg-news4432@mailblocks.com> wrote:Actually the date is being stored in an Access DB. The format for the field in the database is mm/dd/yyyy and yet I still get those extra zero's. Weird....Here's what I tried and it seems to be working now. Thanks Richard! $var = date("m-d-Y", strtotime($dbDate)); $var then has the value of the date only. Still curious as to why those extra zero's are tacked on.It's because MySQL is storing the date accurate to the second. Are you assuming the time is not stored, because you do a select at the MySQL prompt and don't see it? If so, that's the misunderstanding. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'ReillyComing Fall 2004HTTP Developer's Handbook - Samshttp://httphandbook.org/PHP Community Sitehttp://phpcommunity.org/