A DESCRIPTION OF THE REQUEST :
The xsd:dateTime can carry several formats, among them
2005-10-20T22:22:22+01:00
2005-10-20T22:22:22Z
(cf http://books.xmlschemata.org/relaxng/ch19-77049.html)
These formats cannot be produced or parsed from within SimpleDateFormat, because
"z" will parse/produce "GMT-08:00" (the "GMT is too much) and "Z" will parse/produce
"-0800" (missing ":").
JUSTIFICATION :
Looking at the various SOAP implementations out there, all of them use different
SimpleDateFormat strings in combination with String arithmetics, substring, substituting etc. Bugs and incompatibilities are to be expected.
Really, this is quite a basic thing and should be handled within the API.
Lots of people with similar thoughts (and problems) can be found in any forum.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Either a)
SimpleDateFormat has some new formatting tokens that correspond to the xsd:dateTime
part or
b) a new XSDDateFormat is implemented in java.text.*
ACTUAL -
There is no easy, consistent and safe way in the API to have this done.
CUSTOMER SUBMITTED WORKAROUND :
set timezone to GMT, then output timezone part with "z" and perform some modification,
like, replace "+00:00" with "Z", and remove the "GMT" part from the result
The xsd:dateTime can carry several formats, among them
2005-10-20T22:22:22+01:00
2005-10-20T22:22:22Z
(cf http://books.xmlschemata.org/relaxng/ch19-77049.html)
These formats cannot be produced or parsed from within SimpleDateFormat, because
"z" will parse/produce "GMT-08:00" (the "GMT is too much) and "Z" will parse/produce
"-0800" (missing ":").
JUSTIFICATION :
Looking at the various SOAP implementations out there, all of them use different
SimpleDateFormat strings in combination with String arithmetics, substring, substituting etc. Bugs and incompatibilities are to be expected.
Really, this is quite a basic thing and should be handled within the API.
Lots of people with similar thoughts (and problems) can be found in any forum.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Either a)
SimpleDateFormat has some new formatting tokens that correspond to the xsd:dateTime
part or
b) a new XSDDateFormat is implemented in java.text.*
ACTUAL -
There is no easy, consistent and safe way in the API to have this done.
CUSTOMER SUBMITTED WORKAROUND :
set timezone to GMT, then output timezone part with "z" and perform some modification,
like, replace "+00:00" with "Z", and remove the "GMT" part from the result
- duplicates
-
JDK-4919632 RFE: SimpleDateFormat should fully support ISO8601 standard for timezone
-
- Closed
-