RT wrote:
[Please don't send MIME encoded messages. Thank you]
How would I format a timestamp which is used to show when a quote was
created in a record set.
This is the echo -
<?php echo($row_rsquote['created']); ?>
I tried doing this -
<?php echo date('D, m/d/Y',$row_rsquote['created']); ?>
but all I get is Monday, 01/18/2038.
Can anyone tell me how I can echo the value in the correct date format ?
A TIMESTAMP returns from MySQL as, eg, "20040512171115".
You cannot apply that to the PHP date() function (or you can, but the
results are not what you expect :) ).
I'd return a UNIX_TIMESTAMP from the database instead:
select fld1, fld2, UNIX_TIMESTAMP(created) as created, fld4
from table
...
which returns something that PHP interprets correctly, sparing you the
trouble to convert the timestamp in PHP.
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :