Re: formatting a date from mysql

From: Date: Mon, 12 Dec 2005 16:15:43 +0000
Subject: Re: formatting a date from mysql
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-40848@lists.php.net to get a copy of this message
Eternity Records Webmaster wrote:
I need to figure out how to format the date format: year-month-day (2005-12-06). It is a date(8) field in a mysql table that i pulled out of the table with php 5.0.5. I need it in the format: Tue December 6, 2005 (or in mysql's formatting: 6-12-2005). I am using the reformatting for display only. So it would be something like this: echo $journal['Date']; //with whatever formatting needed If possible I need php to do the formatting for me. Thanks...
An easy way to do it: <?php explode("-",$date); $journal['Date'] = $date[2] . "-" . $date[1] . "-" . $date[0]; ?>

« previous php.db (#40848) next »