At 04:58 PM 12/4/02 -0700, Jeff Bluemel 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
$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;

You may need to adjust the numbers in the substrs...

Rick


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to