Re: date
| From: | 1LT John W. Holmes | Date: | Tue, 19 Nov 2002 14:54:53 +0000 |
| Subject: | Re: date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125095@lists.php.net to get a copy of this message | ||
> I am pulling from a datetime field in mysql. The actual data looks like
> this: 2002-11-30 00:00:00 When I output the data to the page, I want it
to
> appear as 11/30/2002. I want to use a php date format. I do not want it
> formatted as it comes out of the db. But date("m/d/y", $myrow[departdate])
> returns 12/31/69. How can I do this?
You have to convert the mysql date into a unix timestamp in order for it to
be used with date. You can do it in your query by selecting
UNIX_TIMESTAMP(your_column) and using what you have above, or you can try
the following with the query you already have.
date('m/d/Y',strtotime($myrow['departdate'])
---John Holmes...