Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

PHP/MySQL Date display format

Explorer ,
Mar 13, 2007 Mar 13, 2007
Can someone help me out here. I am trying to format my date. My MySQL is a "datetime". How ever I would like to display only the month, day, year like so "Jan,15,2007"

Here is my current code, what should I add to make it do what I want.

<?php echo $row_Recordset1['review_date']; ?>

Thanks
TOPICS
Server side applications
456
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 13, 2007 Mar 13, 2007
Try this:

<?php echo Date("M d, Y", strtotime($row_Recordset1['review_date'])); ?>

--
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com


"newhorizonhosting.com" <charles@dieselinteractive.com> wrote in message news:et7lf6$q8a$1@forums.macromedia.com...
> Can someone help me out here. I am trying to format my date. My MySQL is a
> "datetime". How ever I would like to display only the month, day, year like so
> "Jan,15,2007"
>
> Here is my current code, what should I ad...
Translate
LEGEND ,
Mar 13, 2007 Mar 13, 2007
Try this:

<?php echo Date("M d, Y", strtotime($row_Recordset1['review_date'])); ?>

--
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com


"newhorizonhosting.com" <charles@dieselinteractive.com> wrote in message news:et7lf6$q8a$1@forums.macromedia.com...
> Can someone help me out here. I am trying to format my date. My MySQL is a
> "datetime". How ever I would like to display only the month, day, year like so
> "Jan,15,2007"
>
> Here is my current code, what should I add to make it do what I want.
>
> <?php echo $row_Recordset1['review_date']; ?>
>
> Thanks
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2007 Mar 14, 2007
On Wed, 14 Mar 2007 02:08:38 +0000 (UTC), "newhorizonhosting.com"
<charles@dieselinteractive.com> wrote:

>Can someone help me out here. I am trying to format my date. My MySQL is a
>"datetime". How ever I would like to display only the month, day, year like so
>"Jan,15,2007"

You should format it using your SQL statement. See this:

http://www.dan.co.uk/mysql-date-format/
--
Steve Fleischer
steve at flyingtigerwebdesign dot com
Hong Kong
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2007 Mar 14, 2007
LATEST
newhorizonhosting.com wrote:

> Can someone help me out here. I am trying to format my date. My MySQL is a
> "datetime". How ever I would like to display only the month, day, year like so
> "Jan,15,2007"


mysql> SELECT DATE_FORMAT(NOW(),"%b %e, %Y") as review_date;
+--------------+
| review_date |
+--------------+
| Mar 14, 2007 |
+--------------+
1 row in set (0.00 sec)

Best done in mysql.
Mick

>
> Here is my current code, what should I add to make it do what I want.
>
> <?php echo $row_Recordset1['review_date']; ?>
>
> Thanks
>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines