You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Ogren, Philip V." <Og...@mayo.edu> on 2001/11/14 15:06:15 UTC

DateField - dates before 1970

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>