Re: date format display

From: Date: Mon, 10 Jun 2002 14:17:05 +0000
Subject: Re: date format display
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19717@lists.php.net to get a copy of this message
on 6/10/02 9:00 AM, fabrizio at fabrizio@sad.it appended the following bits to my mbox: > in my mysql-db I have a date_tbl with this format: (20020531). > how is possible in PHP do display date_tbl's values in a more human-readable > format like 05-31-2002 or 31/05/2002 ? In your query, you can use the MySQL date_format function. See the documentation here: <http://www.mysql.com/doc/D/a/Date_and_time_functions.html> Example: SELECT movie_title, DATE_FORMAT(movie_start_date, '%m/%d/%Y') AS start_date_formatted FROM movies_table WHERE movie_id="3"; Hope that helps. Sincerely, Paul Burney <http://paulburney.com/> <?php // the statement formerly known as prince if ($the_elevator == 'tries to bring you down') { go_crazy('punch a higher floor'); } ?>

« previous php.db (#19717) next »