Re: formating numbers & date

From: Date: Thu, 05 Dec 2002 00:51:13 +0000
Subject: Re: formating numbers & date
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-127074@lists.php.net to get a copy of this message
on 05/12/02 11:37 AM, Rick Widmer (php3@developersdesk.com) wrote: > $Hour = substr( $Date, 11, 2 ); > if( $Hour ) > 12 { > $Hour = $Hour - 12; > $AMPM = 'PM'; > } > > else { > $AMPM = 'AM'; > } > > echo substr( $Date, 5, 2 ), '/', substr( $Date, 8, 2 ), '/', > substr( $Date, 0, 4 ), ' ', $Hour, substr( $Date, 13, 6 ), $AMPM; Isn't this a little simpler? <? $newdate = date('n/j/Y g:i:s a', strtotime($date)); echo $newdate; ?> There's always more than one way to do something I guess :) Justin French -------------------- http://Indent.com.au Web Development & Graphic Design --------------------

« previous php.general (#127074) next »