Jump to content

ORDER BY Date


limitphp

Recommended Posts

ORDER BY copyrightDate

 

I think that should do the trick on it's own. If not try adding DESC or ASC after copyrightDate and see if that gets you what you are after.

 

btw, that is a really bad format to store the time in. Timestamp is way more flexible and preferred =)

Link to comment
https://forums.phpfreaks.com/topic/137586-order-by-date/#findComment-719132
Share on other sites

ORDER BY copyrightDate

 

I think that should do the trick on it's own. If not try adding DESC or ASC after copyrightDate and see if that gets you what you are after.

 

btw, that is a really bad format to store the time in. Timestamp is way more flexible and preferred =)

 

ok thanks.  I'll change it to timestamp.  When I change, will it still be the same, ORDER BY copyrightDate?

Link to comment
https://forums.phpfreaks.com/topic/137586-order-by-date/#findComment-719145
Share on other sites

ORDER BY copyrightDate

 

I think that should do the trick on it's own. If not try adding DESC or ASC after copyrightDate and see if that gets you what you are after.

 

btw, that is a really bad format to store the time in. Timestamp is way more flexible and preferred =)

 

ok thanks.  I'll change it to timestamp.  When I change, will it still be the same, ORDER BY copyrightDate?

 

Probably need the DESC after it like Maq mentioned.

Link to comment
https://forums.phpfreaks.com/topic/137586-order-by-date/#findComment-719149
Share on other sites

Yeah I think ASC is default if you don't specify.  And since you want most recent, you want descending because that will list greatest to least, so to speak.

 

It's fairly easy to convert timestamps to formatted dates.  PHP handles this feature very well.

Link to comment
https://forums.phpfreaks.com/topic/137586-order-by-date/#findComment-719153
Share on other sites

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.