You are here: Re: Sort dates when stored as epoch « All PHP « IT news, forums, messages
Re: Sort dates when stored as epoch

Posted by Geoff Berrow on 04/13/06 09:44

Message-ID: <JDi%f.23342$_26.13018@tornado.texas.rr.com> from Don Hobson
contained the following:

>I need to sort my job postings from today to the past, but my date sort
>basically sorts dates from Dec to Jan . How do I get the sort to start from
>the todays date backwards?
....
>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

The query is fine, the problem is your time stamps.
1165963600 is 2006-12-12

In other words, it is in the future. The others probably are too.

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011

 

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

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