lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <>
Subject [jira] [Commented] (SOLR-1899) dates prior to 1000AD are not formatted properly in responses
Date Sat, 07 May 2011 04:33:03 GMT


Hoss Man commented on SOLR-1899:

Status update.

After doing some more research: 

* it seems pretty clear that SimpleDateFormat is fundamentally incapable of formatting negative
years (other then using an Era string).

* the parseDateTime/printDateTime methods in javax.xml.bind.DatatypeConverter *should* be
the perfect solution -- they specifically exist for dealing with XSD dates.  But in testing
they seem to be completely broken as far as the milliseconds and the requirement that "The
fractional second string, if present, must not end in '0';"

* based on all the recommendations I found online, i started investigated JodaTime.  It has
an ISODateTimeFormat factory class that looked promising, but it doesn't seem to support any
implementations that are designed for dealing with the canonical form, nor did i have much
look using the JodaTime DateTimeFormatterBuilder API to construct one.  details are here:

At this point, barring some really awesome insights from anyone else or the JodaTime forum,
I'm thinking that (as much as i hate it) hand rolled date parsing/formatting code may be the
way to go once and for all.


> dates prior to 1000AD are not formatted properly in responses
> -------------------------------------------------------------
>                 Key: SOLR-1899
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.2, 1.3, 1.4
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>         Attachments: SOLR-1899.patch
> As noted on the mailing list, if a document is added to solr with a date field such as
"0001-01-01T00:00:00Z" then when that document is returned by a search the year will be improperly
formated as "1-01-01T00:00:00Z"

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message