Re: formatting date issues

From: Date: Tue, 04 May 2004 13:01:07 +0000
Subject: Re: formatting date issues
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-185301@lists.php.net to get a copy of this message
The database is returning the dates in standard SQL format. Use date(): <?php echo date( "F j, Y", strtotime( $row_rsNewsDate['date'] ) ) ?> http://www.php.net/manual/en/function.date.php cheers, Travis msa 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!!!!!
-- Travis Low <mailto:travis@dawnstar.com> <http://www.dawnstar.com>

« previous php.general (#185301) next »