lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danil ŢORIN <torin...@gmail.com>
Subject Re: about some date store
Date Wed, 11 Jul 2012 11:10:47 GMT
Listen to Uwe.

Keeping your date/time in milliseconds is the best solution.

You don't care about how the user likes his data DD.MM.YYYY (Europe)
of MM.DD.YYYY(US), about timezones, daylight saving changes, leap
seconds, or any other complications.

Your dates are simple long numbers, you can easy sort them, do ranges
and whatever you like.


On Wed, Jul 11, 2012 at 12:15 PM, Uwe Schindler <uwe@thetaphi.de> wrote:
> Hi,
>
> Use NumericField and NumericRangeQuery to query. For sorting use the
> corresponding datatype. In the numeric field you would parse the date to a
> number (e.g. milliseconds since epoch) and index it using NumericField. To
> print them, use SimpleDateFormat or whatever to convert the numeric value
> back to a date after you got the results.
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: sam [mailto:hairen512@yahoo.com.cn]
>> Sent: Wednesday, July 11, 2012 10:32 AM
>> To: java-user@lucene.apache.org
>> Subject: about some date store
>>
>> I want store some data like 00:00:00.123,it's string,i want print it as
> date
>> .because i want sort it as date's increase.
>>
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/about-
>> some-date-store-tp3994330.html
>> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message