| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
|||
How do I format mySQL date?I have a forum and would like to run a query where I can get the member id, topic id and date that it was read. I am able to do this but the date comes out in an unreable 10 digit number. How do I run the query so it reads as a regular date>
Below, I am looking for topic id 5160 to see all the member ids who read it and the dates. SELECT 5160, read_mid, read_date FROM ibf_topics_read |
|
|||
|
I think your date is stored as a UNIX timestamp. MySQL has functions to convert this to 'normal' date formats. See http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html for more info.
SELECT read_mid, FROM_UNIXTIME(read_date) AS read_date FROM ibf_topics_read WHERE id = 5160 |
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do i create a query to extract all records within a given date. For instance beginning date and? | Richard Amaning | SQL - Questions and Answers | 1 | 09-29-2006 06:23 AM |
| How to retrieve records which the date column should be 36 months older than the current date? | lowie | SQL - Questions and Answers | 1 | 08-21-2006 03:39 AM |