commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ayush Chaubey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1305) FastDateFormat in 3.5 failed test of 3.3.2 while parsing 2014-12-15T19:50:00-05:00
Date Sat, 28 Jan 2017 15:07:25 GMT

    [ https://issues.apache.org/jira/browse/LANG-1305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15844086#comment-15844086
] 

Ayush Chaubey commented on LANG-1305:
-------------------------------------

According to the API the date pattern in FastDateFormat follows SimpleDateFormat.
In the issue above the specified date is -
2014-12-15T19:50:00-05:00

whereas it should be -
2014-12-15T19:50:00-0500

The reason is that letter 'Z' is used to represent RFC 822 time zone and its format is like
- 0500

> FastDateFormat in 3.5 failed test of 3.3.2 while parsing 2014-12-15T19:50:00-05:00
> ----------------------------------------------------------------------------------
>
>                 Key: LANG-1305
>                 URL: https://issues.apache.org/jira/browse/LANG-1305
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.time.*
>    Affects Versions: 3.5
>         Environment: Windows7, JDK1.8U112
>            Reporter: Nathanael Yang
>            Priority: Critical
>
> FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ssZ", TimeZone.getTimeZone("GMT-05:00")).parse("2014-12-15T19:50:00-05:00");
> This will work on 3.3.2, however, when I upgraded to 3.5 it failed like this:
> Exception in thread "main" java.text.ParseException: Unparseable date: 2014-12-15T19:50:00-05:00
> This made me suprized and I have to carefully check my unit tests to see whether upgrade
to 3.5 is reliable.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message