|
Posted by Martin Toombs on 07/09/05 02:36
That's what I was looking for. Everywhere I looked it told me how to
format today's date when I wanted to format a date field coming from the
database.
Thanks for the help.
nemo wrote:
> On Thu, 07 Jul 2005 20:00:13 -0400, Jim Moseby <nospam@dontspam.me> wrote:
>
> >Martin Toombs wrote:
> >> I'm trying to format a date field in PHP which has been stored in a date
> >> field and can't get it to work.
> >>
> >> I've tried date() and date_format() to no avail. It works if I want to
> >> display today's date, but I want to format the display of the date which
> >> is coming form the database field.
> >>
> >> Unformatted, it looks like 2005-07-02 21:53:00
> >>
> >> I want it to read July 2, 2005.
> >>
> >> Any help will be appreciated.
> >
> >select date_format(datefieldname, "%M %e, %Y") from tablename;
> >
> >JM
> There's also -
> $readable_date=date("jS F Y", strtotime($Row[date_in_database]));
> Did you look at -
> http://uk.php.net/date
>
>
Navigation:
[Reply to this message]
|