Hi
I use JodaTime to parse ISO8601 strings from web service xml.
If the iso8601 string is missing offset information, JodaTime by default
uses the time zone that is default for the VM the code is running on.
Is there a way through JodaTime to verify that the iso8601 string actually
has an offset defined so I can throw an Exception instead of JodaTime just
going for the default time zone.
In other words, I would like to parse "2011-02-02T02:30:30.000+02:30"
without any problem, but I would like to throw an exception if the string
looks like "2011-02-02T02:30:30.000", instead of JodaTime parsing this
using the server default time zone.
It is of course easy to write code for this, but I just wondered if there
is something in JodaTime that could be used.
The method
public static DateTimeFormatter forFields(
Collection<DateTimeFieldType> fields,
boolean extended,
boolean strictISO)
looked promising (because of the strictIOS parameter), but there is
no DateTimeFieldType for the offset field type.
regards,
Bård Dybwad Kristensen
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest