Re: formating numbers & date
| From: | Justin French | Date: | Thu, 05 Dec 2002 00:49:44 +0000 |
| Subject: | Re: formating numbers & date | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-127073@lists.php.net to get a copy of this message | ||
on 05/12/02 11:15 AM, Justin French (justin@indent.com.au) wrote:
> Hi,
>
> <?
> $date = '2002-12-04 23:21:49';
> $newdate = date('m/d/Y', strtotime($date));
> echo $newdate;
> ?>
Whooops, forgot the time bit!
Should be
<?
$date = '2002-12-04 23:21:49';
$newdate = date('n/j/Y g:i:s a', strtotime($date));
echo $newdate;
?>
echo's 12/4/2002 11:21:49 pm
also fixed the leading zero's problem :)
Justin French
--------------------
http://Indent.com.au
Web Development &
Graphic Design
--------------------