0
PHP Date Funcing using recordset

/t5/dreamweaver-discussions/php-date-funcing-using-recordset/td-p/120729
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"); ?>
<?php echo date($row_userIDs['dateOfReg'], "M j, Y"); ?>
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/php-date-funcing-using-recordset/m-p/120730#M89412
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"); ?>
<?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"); ?>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/dreamweaver-discussions/php-date-funcing-using-recordset/m-p/120732#M89414
Aug 30, 2008
Aug 30, 2008
Copy link to clipboard
Copied
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/dreamweaver-discussions/php-date-funcing-using-recordset/m-p/120731#M89413
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
> 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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

