> 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... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php