You are here: How to sort date based on Today « PHP SQL « IT news, forums, messages
How to sort date based on Today

Posted by Don Hobson on 04/13/06 05:23

I need to sort my job postings from today to the past, but my date sort
basically sorts dates from January to December. How do I get the sort to
start from the today's date back

SELECT jobs.id, jobs.jobtitle, jobs.companyname, jobs.zipcodeId,
jobs.neighborhoodId, neighborhood.name, jobs.created FROM jobs, neighborhood
WHERE jobs.neighborhoodId = neighborhood.id ORDER BY created DESC

Lets say today is April 12th.

I store the dates in mysql as epoch dates (1165963600)
My sort incorrectly shows like this descending

Dec 12 - 1165963600
Aug 19
Aug 19
Jul 08
Jul 08
Jun 05
Apr 12
Apr 12
Apr 12


I want it to show like this for

Apr 12
Apr 12
Apr 12

Dec 12
Aug 19
Aug 19
Jul 08
Jul 08
Jun 05

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация