Re: formating numbers & date
| From: | Justin French | Date: | Thu, 05 Dec 2002 00:15:14 +0000 |
| Subject: | Re: formating numbers & date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127061@lists.php.net to get a copy of this message | ||
Hi,
<?
$date = '2002-12-04 23:21:49';
$newdate = date('m/d/Y', strtotime($date));
echo $newdate;
?>
Should do the trick -- although I haven't stripped out the leading 0 in
either the day or month, hence it will echo 12/04/2002, not 12/4/2002.
Season to taste,
Justin
on 05/12/02 10:58 AM, Jeff Bluemel (jeff@domintcom.com) wrote:
> I'm displaying a date that I get from a informix database query - the date
> format is as follows;
>
> 2002-12-04 23:21:49
>
> I want it to display as 12/4/2002 11:21:49 PM
>
> Jeff
>
> "Jason Wong" <php-general@gremlins.biz> wrote in message
> news:200212041521.30351.php-general@gremlins.biz...
>> On Wednesday 04 December 2002 08:29, Jeff Bluemel wrote:
>>
>>> ... but the date format doesn't seem to
>>> allow me to pass it a date.
>>
>> Your code?
>>
>> --
>> Jason Wong -> Gremlins Associates -> www.gremlins.biz
>> Open Source Software Systems Integrators
>> * Web Design & Hosting * Internet & Intranet Applications Development *
>>
>> /*
>> Information Processing:
>> What you call data processing when people are so disgusted with
>> it they won't let it be discussed in their presence.
>> */
>>
>
>
Justin French
--------------------
http://Indent.com.au
Web Development &
Graphic Design
--------------------