Re: Newby: DATE Question
| From: | Marek Kilimajer | Date: | Thu, 24 Oct 2002 16:11:24 +0000 |
| Subject: | Re: Newby: DATE Question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121303@lists.php.net to get a copy of this message | ||
Use SELECT *, DATE_FORMAT(date,'%d/%m/%y') AS print_date .....
and then you have a printable date in $thread['print_date']
Doug Coning wrote:
Hi everyone, Sorry for this basic question, but I can't seem to get the code to work. In my MySQL database I have a column that is a TIMESTAMP to automatically stamp the date when created. However, I can't get it to pull correctly into my php result. Here is a sample of one record that has the value of 20021024083050 in the date column. In my php code I have the following pieces of coding (there's more than this, but this is what's returning the date). $query = "SELECT * FROM posting ORDER BY date DESC"; $date = strftime("%d/%m/%y", $thread['date']); And this is the result I receive: Result: 18/01/38 PLEASE help. I have changed the code and can't get it to work. Thank you!!!!! Doug Coning