FULL PRODUCT VERSION :
1.5, and probably others.
1.6.0_16-b01
A DESCRIPTION OF THE PROBLEM :
SimpleDateFormat RFC822 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
RFC822.parse("2009-08-07T15:00:00.000-0000"); // Succeeds -- no colon in tz offset
RFC822.parse("2009-08-07T15:00:00.000-05:00"); // Fails -- colon in tz offset
RFC822.parse("2009-08-07T15:00:00.000Z"); // Fails -- "Z" used for Zulu
My reading of http://tools.ietf.org/html/rfc3339#section-5.8 is that the time zone offset should include a colon, and that "Z" is a valid suffix (representing Zulu time). The feed I receive (Google Calendar) does return timestamps with colons or Z. I would like to parse those times, but SimpleDateFormat won't cooperate. SimpleDateFormat documentation states that the pattern character "Z" is a "RFC 822 time zone". So either the documentation is wrong, the implementation is wrong, or I'm just mixed up.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use my code snippet, above.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect valid RFC822 time stamps to be parsed.
ACTUAL -
Valid RFC822 time stamps failed to parse.
REPRODUCIBILITY :
This bug can be reproduced always.
1.5, and probably others.
1.6.0_16-b01
A DESCRIPTION OF THE PROBLEM :
SimpleDateFormat RFC822 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
RFC822.parse("2009-08-07T15:00:00.000-0000"); // Succeeds -- no colon in tz offset
RFC822.parse("2009-08-07T15:00:00.000-05:00"); // Fails -- colon in tz offset
RFC822.parse("2009-08-07T15:00:00.000Z"); // Fails -- "Z" used for Zulu
My reading of http://tools.ietf.org/html/rfc3339#section-5.8 is that the time zone offset should include a colon, and that "Z" is a valid suffix (representing Zulu time). The feed I receive (Google Calendar) does return timestamps with colons or Z. I would like to parse those times, but SimpleDateFormat won't cooperate. SimpleDateFormat documentation states that the pattern character "Z" is a "RFC 822 time zone". So either the documentation is wrong, the implementation is wrong, or I'm just mixed up.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Use my code snippet, above.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect valid RFC822 time stamps to be parsed.
ACTUAL -
Valid RFC822 time stamps failed to parse.
REPRODUCIBILITY :
This bug can be reproduced always.
- duplicates
-
JDK-4919632 RFE: SimpleDateFormat should fully support ISO8601 standard for timezone
-
- Closed
-