> Hi Chris..
> thanks but your code generate the following error
> Warning: date() [function.date]: Unexpected error in .....
> what's wrong? any idea ??

Sorry.  You just need to take out this line:

echo strtotime = ($timy);

either that, or change it to:

echo strtotime( $timy ) . ' = ' . ($timy) . '<br>';

But more important than that, are you certain that MySQL is
returning '20030714012548' as the value for the timestamp
field?  That doesn't look quite right.  Alternately, you can return
the value you need (to pass to the date() function) by making
your query look like this:

SELECT blah, 
              UNIX_TIMESTAMP( field_name ) as field_name_unixtime
FROM table
WHERE blah.

// run query
$dataRow = mysql_fetch_assoc( $result );
echo date( 'Y-m-d', $dataRow['field_name_unixtime'] );

For more information on this and other date functions in MySQL
(which, depending on your needs, should be the place to put your
date manipulations), you can go to this page:

http://www.mysql.com/doc/en/Date_and_time_functions.html

Chris


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

Reply via email to