Jump to content

Convert time from Query


phpSensei

Recommended Posts

I have a time stamp in a phpbb table called topic_time

 

$query1 = "Select * FROM phpbb_topics WHERE forum_id = 1 ORDER BY topic_time ASC LIMIT 3  ";

 

How would I convert that topic_time timestamp to a real date from the query?

 

ex:

 

$query1 = "Select * FROM phpbb_topics WHERE forum_id = 1 ORDER BY ".date("Y M D", "topic_time"). "ASC LIMIT 3  ";

 

doesnt seem to work though.

Link to comment
https://forums.phpfreaks.com/topic/71310-convert-time-from-query/
Share on other sites

it is in the phpbb table for the time the topic was posted. I am taking all the topics from the news forum (which is id 1 ) and displaying it on the frontpage, but topic_time is a timestamp, and I want to convert it into a date in the query, so it is ordered by the date.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.