lucene-dev mailing list archives

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

    [ https://issues.apache.org/jira/browse/SOLR-1899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13030272#comment-13030272
] 

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:
https://sourceforge.net/projects/joda-time/forums/forum/337835/topic/4519752

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.

ugh.



> dates prior to 1000AD are not formatted properly in responses
> -------------------------------------------------------------
>
>                 Key: SOLR-1899
>                 URL: https://issues.apache.org/jira/browse/SOLR-1899
>             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: http://www.atlassian.com/software/jira

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


Mime
View raw message