Reply to Re: Sort dates when stored as epoch

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на 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

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