RESTBody::getISO8601Formatter doesn't handle microseconds #20

pagameba opened this Issue Apr 16, 2012 · 0 comments


None yet
1 participant

RESTBody::getISO8601Formatter() returns a formatter that doesn't handle microseconds, the spec however allows for up to 3 digit microsecond representation. Personally I don't care for the level of precision :) but when feeding documents with dates created by javascript clients, the default getISOString on a javascript Date object does include the additional precision. The quicky-and-dirty solution is to add .AAA to the formatter but then this breaks timestamps created without 3 digits of precision. I can't think of a good solution for this that doesn't create multiple formatters or modify the stored value (and hence cause spurious revisions to be generated).

I did check he has an NSFormatter subclass ISO8601DateFormatter that could be a drop-in replacement but I don't know how compatible it would be to use this with CouchCocoa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment