Type: New Feature
Affects Version/s: None
Fix Version/s: 1.1.3
contribute a ISO8601SqlTimestampConverter.java and its testcase ISO8601SqlTimestampConverterTest.java
Would be nice if we could find a way to support the micro/nano seconds. Few people read JavaDoc and it's the kind of thing that could cause an unexpected bug in someone's application. Are there any alternatives to Joda?
Something to check for is thread safety. I'm not familiar with the Joda libraries but I encountered a problem using the standard Java DateFormat classes because they are not thread safe. My workaround was to use a pool of formatters to get the balance of performance and thread safety (see DateConverter).
Joda DateTime is thread-safe: http://joda-time.sourceforge.net/faq.html#threading
As for the micro/nano seconds support, I'd be worth dropping them a line to ask.
Maybe there is a way to do it that we've overlooked.
BTW, joda-time 1.1 has been released.
The question is, do we really need 500k joda-time to convert dates according ISO8601? I've written once an ISO8601DateFormat implementation that was based on the SimpleDateFormat (customer wanted to use ISO8601 symbols to define his own formats), that supported most cases. Since we can define, which exact string representation in ISO8601 format we support, it would be much less overhead. Multithreading support was realized with thread locals. WDYT?
Support for nano fraction added. Open question is still to use full-blown joda for this type of "simple" conversion?
It's the age-old question of development: custom or re-use?
I used joda-time because it was already done/tested and available to use.
I have no strong bias against using a custom converter.
I withdraw my proposal
With the failing tests for 1.3 I had to recognize, that a core functionality supporting ISO8601with plain Java is missing (at least for 1.3). In the end it is not so difficult to write an own specialized converter using the SimpleDateFormat to work with ISO8601 formatted dates.
Joe can you make a review here? The problem with this converter is, that it cannot handle the micro and nano part of the Timestamp. Though the ISO standard covers IMHO a arbitrary resolution for the fraction (by adding the necessary number of 's' after the fraction), it is not supported by Joda (at least not by DateTime). So you may decide, if it should stay. For now I've added a note to javadoc.