MySQL Timestamp to Date conversion

From: Date: Sat, 05 Aug 2000 00:32:10 +0000
Subject: MySQL Timestamp to Date conversion
Groups: php.general 
Request: Send a blank email to php-general+get-10226@lists.php.net to get a copy of this message
I read at the PHP.NET site in the documentation that this should format a MySQL timestamp into a readable date format. Anyone have any ideas? Heres a code segment that illistrates what Im trying to accomplish. <?PHP // //CREATE TABLE SomeTable ( timestamp TIMESTAMP, NAME char(60) ); // $q = "SELECT timestamp FROM SomeTable"; $r = mysql_query( $q ); while ( $row = mysql_fetch_array( $r ) ) { $formatdate = date("M/D/Y H:i:s", time( $timestamp )); // THIS NOT WORKING? print "$formatdate<BR>"; } ?> -- Strider Centaur HTTP://www.Scifi-Fantasy.com " It is my observation that unless you really understand the issues, you are hardly in a position to criticize. Nearly all Linux users have used Windows, but very few Windows users have used Linux. " -- Me

« previous php.general (#10226) next »