Alex Rivera | Logout

ORDER By Unix Timestamp DESC or ASC?

Asked 2011-02-16T19:39:22.837
16

I have news items that when created adds the time of creation date/time in unix timestamp format into the database. If i wanted to order by most recent first would i use ASC or DESC in my mysql query?

EDIT:

Thanks everyone for replying. I understand now. I will make Sarfraz answer the accepted solution as he was first to reply but thanks to everyone else to :) . Have to wait 11 minutes before i can accept it as a solution.

Edit
Report

1 Answer

31

DESC - timestamps are "higher = newer" number. So sorting by DESC(ending) will put the highest (newest) entries first.

answered 2011-02-16T19:40:48.437

Your Answer