lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ogren, Philip V." <Ogren.Phi...@mayo.edu>
Subject DateField - dates before 1970
Date Wed, 14 Nov 2001 14:06:15 GMT

The method DateField.dateToString(Date date) throws an exception if the long
value of Date.getTime() is negative.  Therefore, it is not possible to
'encode' dates that are prior to 1970.  I think a limitation like this
should be clearly documented.  Please let me know if I have missed something
here.  

A possible work-around would be to add 200 years (or what ever is
*necessary*) worth of milliseconds to the value that is passed into
DateField.timeToString() and then subtract it from the return value of
DateField.stringToTime().  I'm going to try this, unless someone warns me
not to.  

I am using lucene-1.2-rc1

Thanks for your consideration,

Philip

> Philip V. Ogren
> Medical Information Resources
> Mayo Clinic Rochester
> (507) 538-0167
> ogren@mayo.edu


--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message