Date formatting question

Date formatting question

am 09.04.2009 03:41:33 von Jack Lauman

I need to reformat the output of the 'dates' field from '2009-04-08' to
'Wed. Apr. 8th'. Any help would be appreciated.

Thanks.

---

for ($counter = 0; $counter < mysql_num_rows($resultID); $counter++);

while ($row = mysql_fetch_object($resultID))
{
print "";
print "" . $row->dates . "";
print "" . $row->times . "";
print "" . $row->am_pm . "";
print "" . $row->height . "";
print "" . $row->cond . "";
print "";
}


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Date formatting question

am 09.04.2009 04:05:21 von dmagick

Jack Lauman wrote:
> I need to reformat the output of the 'dates' field from '2009-04-08' to
> 'Wed. Apr. 8th'. Any help would be appreciated.

You can either do it using mysql date formats (see
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functio ns.html#function_date-format)
or something like date('...', strtotime($result->date));

See http://php.net/date and http://php.net/strtotime

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Date formatting question

am 09.04.2009 05:54:32 von Phpster

See the date function

Http://www.php.net/date

Bastien

Sent from my iPod

On Apr 8, 2009, at 21:41, Jack Lauman wrote:

> I need to reformat the output of the 'dates' field from '2009-04-08'
> to 'Wed. Apr. 8th'. Any help would be appreciated.
>
> Thanks.
>
> ---
>
> for ($counter = 0; $counter < mysql_num_rows($resultID); $counter++);
>
> while ($row = mysql_fetch_object($resultID))
> {
> print "";
> print "" . $row->dates . "";
> print "" . $row->times . "";
> print "" . $row->am_pm . "";
> print "" . $row->height . "";
> print "" . $row->cond . "";
> print "";
> }
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php