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

PHP Date Funcing using recordset

Guest
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

How do I make a date function using recordset. I tried this method but I am getting an error.
<?php echo date($row_userIDs['dateOfReg'], "M j, Y"); ?>
TOPICS
Server side applications

Views

382
Translate

Report

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 ,
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

Try this:

<?php echo date("M j, Y", strtotime($row_userIDs['dateOfReg'])); ?>

http://us2.php.net/date

http://us.php.net/strtotime

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


"AdonaiEchad" <webforumsuser@macromedia.com> wrote in message
news:g9aesk$eh1$1@forums.macromedia.com...
> How do I make a date function using php and my recordset. I tried this
> method but I am getting an error.
> <?php echo date($row_userIDs['dateOfReg'], "M j, Y"); ?>

Votes

Translate

Report

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
Guest
Aug 30, 2008 Aug 30, 2008

Copy link to clipboard

Copied

LATEST
Thank you for all of your help. I have tried the MySQL version and I do prefer that, but some how I had to do something different that is only php and not touch the MySQL database.

Votes

Translate

Report

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 ,
Aug 30, 2008 Aug 30, 2008

Copy link to clipboard

Copied

On 29 Aug 2008 in macromedia.dreamweaver.appdev, AdonaiEchad wrote:

> How do I make a date function using php and my recordset. I tried
> this method but I am getting an error. <?php echo
> date($row_userIDs['dateOfReg'], "M j, Y"); ?>

It tends to be easier (at least for me) to do the formatting in the
recordset. Assuming you're using MySQL:

SELECT field1, field2, DATE_FORMAT(dateOfReg, '%M %e, %Y') AS myDate FROM
myTable ...

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/contact.php

Votes

Translate

Report

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