Re: Date Formatting
| From: | Charles Killian | Date: | Wed, 13 Sep 2000 06:37:21 +0000 |
| Subject: | Re: Date Formatting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16504@lists.php.net to get a copy of this message | ||
Instead of performing the explode() use strtotime(). It should work.
Charles
----- Original Message -----
From: "Thomas Deliduka" <thomas@neweve.com>
To: "PHP List" <php-general@lists.php.net>
Sent: Tuesday, September 12, 2000 10:47 PM
Subject: Re: [PHP] Date Formatting
On 9/13/00 2:27 AM this was written:
> I have a date in a table in the format d-m-y, but when it is read out onto
the
> screen it comes out in the opposite order. What I am hoping to do is get
it
> into m-d-y order, or better still long format (eg. 9th September, 2000).
Does
> anyone know if this is possible, and if so how it is done?
$thedate = explode("-",<date formatted in Y-m-d>);
echo date("jS F, Y", mktime(0,0,0,$thedate[1], $thedate[2], $thedate[0]);
This will do it for you.
--
Thomas Deliduka
IT Manager
-------------------------
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net