RE: [PHP] Date formating
| From: | David Freeman | Date: | Sat, 15 Feb 2003 11:00:08 +0000 |
| Subject: | RE: [PHP] Date formating | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-135652@lists.php.net to get a copy of this message | ||
> I have a string in this format:
> 2003-02-15 13:19:02
>
> I want to display it in a more readable format like
> Staurday, 11 Februardy,
> 2003, 13:19:02. How can I achieve that. I tried date()
> function but could
> not get what I wanted.
The date format above is a standard mysql date/time format. If this is
where you are getting that date from then your best method is probably
to do the date conversion as part of your mysql query.
You'll need to consult the mysql manual (chapter 6.something from
memory) where it talks about stuff useful in select statements.
Specifically, you're looking for DATE_FORMAT().
If your date is not coming from a database then you'll probably have to
convert the date string you have to a unix timestamp and then use DATE()
from there.
CYA, Dave