Re: Date function
| From: | Don Read | Date: | Thu, 16 Aug 2001 02:22:12 +0000 |
| Subject: | Re: Date function | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-62938@lists.php.net to get a copy of this message | ||
On 16-Aug-2001 David Robley wrote:
> On Thu, 16 Aug 2001 00:38, Mike Mike wrote:
>> Hello,
>> I'm pulling a date out of MySQL as 2001-10-18.
>> How do I make it print October 18 in php?
>> Thanks much
>> --Mike
>
> You could use the Mysql date functions to format it for you. If your date
> field is called date and is a date type:
>
> SELECT CONCAT(MONTHNAME(date), ' ', DAYOFMONTH(date)) AS newdate
>
Ghaakk ...
SELECT DATE_FORMAT(date, '%M %d') as newdate from ...
Regards,
--
Don Read dread@texas.net
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.