Re: formatting date issues
| From: | Marius Dascalu | Date: | Tue, 04 May 2004 13:02:30 +0000 |
| Subject: | Re: formatting date issues | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185303@lists.php.net to get a copy of this message | ||
Hi,
Your date is stored in database in ISO 8601 format.
To convert "2004-03-06" in "March 6, 2004" you can use
folowing code
<CODE>
<?php
echo date("F j, Y",strtotime("2004-03-06"));
?>
</CODE>
in your case replace (if I read properly your code):
<CODE>
echo date("F j, Y",
strtotime("$row_rsNewsDate['date']"));
</CODE>
And, important, don't forget the double quote
HTH
--- msa <melissa@maddesignusa.com> wrote:
> I have a date colum that I am trying to use on a
> page to sort the data in
> reverse choronology. This is working fine, but my
> date is showing up on my
> web page like this: 2004-03-06 and I would like it
> to be like this: March
> 6, 2004
>
> How do I set the table to be able to to take the M
> D, Y format and also show
> up that way on the page, maintaining its ability to
> sort correctly by date?
>
> I am using EMS MySQL Manager to edit the data.
> (Also have access to
> Navicat) Or do I format this on the web page
> itself?
>
> Code from the web page now reads:
>
>
>
> <table class="eMenu" cellspacing="0">
> <tr>
> <td>
> <?php do { ?>
> <a href="#<?php echo
> $row_rsNewsDate['date']; ?>"
> class="eMenu"><?php echo $row_rsNewsDate['date'];
> ?></a>
> <?php } while ($row_rsNewsDate =
> mysql_fetch_assoc($rsNewsDate));
> ?>
>
> </td>
> </tr>
> </table>
>
> Thanks!!!!!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover