Yes, this is an exception where there is a difference between Joda and the
jdk.
I mentioned this a long time ago, but if I remember correctly, the reaction
at the time was that this was not something that would get changed. I
believe that this was the desired behaviour for the joda formatter.
The obvious (and then given) workaround was to have two different patterns
and apply the correct one based on the character in the specific index.
On Thu, Feb 5, 2009 at 8:18 PM, Bridges, Ed (Citco) <ebrid...@citco.com>wrote:
> Hello,
>
>
>
> I'm working on parsing date/time values produced by Sybase (which gives
> very limited control over the formatted output of dates). Two examples of
> different dates provided by it are:
>
> Jan 10 2007 12:00:00:000AM
>
> Jan 10 2007 1:00:00:000AM
>
>
>
> I'm parsing with the pattern: MMM d yyyy h:mm:ss:SSSa
>
>
>
> While I'm able to successfully parse these dates using a SimpleDateFormat
> pattern into java.util.Date instances, the same pattern using Joda produces
> an IllegalArgumentException on dates that follow the second pattern above or
> when the day value is a single digit (see attached test case).
>
>
>
> Apparently, Joda does not interpret "d" and "h" as either one digit or two
> digits while Java does.
>
>
>
> I'm given to assume that Joda is consistent with the patterns in
> SimpleDateFormat – am I missing something here?
>
>
>
> Thanks for your time.
>
>
>
> Ed Bridges
>
>
>
>
>
> Disclaimer link. To see it, click the link below, or copy and paste it into
> your browser's address line. http://www.citco.com/emaildisclaimer.htm
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with
> Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code
> to
> build responsive, highly engaging applications that combine the power of
> local
> resources and data with the reach of the web. Download the Adobe AIR SDK
> and
> Ajax docs to start building applications today-
> http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>
>
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest