Posted by Piet Meins on 04/14/06 00:56
Geoff Berrow schrieb:
> 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.
>
why not using a different way to Rome?
store the dates in something like this:
200603312159 -> 31st march 2006 9.59pm
sorting those numbers should fit Your needs without doing anything else...
[Back to original message]
|