Joda-Time supports formatting ISO8601 in this way - create a LocalDate, LocalTime or LocalDateTime object, and there will be no time zone indicator when formatted.
For parsing, all the dedicated parsers can handle no time zone string formats. for example ISO8601.localDateParser() will receive a date in the format yyyy-MM-dd. Your request is closest to ISO8601.localDateOptionalTimeParser(). Note that when parsing these datetimes, the parseDateTime() method will return a DateTime with a time zone, which will be the boxes default time zone. To avoid this you may want to do: p = ISO8601.localDateOptionalTimeParser().withZone(DatTimeZone.UTC); LocalDateTime ldt = p.parseDateTime().toLocalDateTime(); Having said all of that, all of the above applies if you are using the extended format 2006-10-20T11:39:43. By using the basic format, you are probably beyond what we currently support. So your feature request may be needed. Stephen Mathias Bogaert wrote: > Hi, > > According to Wikipedia (http://en.wikipedia.org/wiki/ISO_8601) the time > zone for the Basic ISO 8601 format *may* include a time zone. > > "If no time zone information is given with a time, the time zone is > assumed to be in some conventional local timezone." > > But JODA's ISODateTimeFormat does not support this. I propose adding a > method called ISODateTimeFormat.basicDateTimeNoMillisNoTimeZone() that > allows for dates like 20061020T113943 to be parsed. > > Cheers, > > Mathias Bogaert > ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Joda-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/joda-interest
