Bug 42740 - ParseException received when date/time that is in the first hour when daylight savings time begins (datetimes before & 1 hour after or later are OK)
Summary: ParseException received when date/time that is in the first hour when dayligh...
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Keywords: ErrorMessage
Depends on:
Reported: 2007-06-26 02:19 UTC by Anuradha Natarajan
Modified: 2009-08-20 08:23 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Anuradha Natarajan 2007-06-26 02:19:27 UTC
The following jsp , with timezone set to "America/Los_Angeles" throws the
following exception

5/8/07 10:34:33:045 EDT] 00000020 WebApp        E   [Servlet           
Error]-[/test.jsp]: java.text.ParseException: Unparseable date:         
"20070311 020000"                                                       
  at java.text.DateFormat.parse(DateFormat.java:352)                    
nown Source)                                                            
  at com.ibm._jsp._test._jspx_meth_fmt_parseDate_0(_test.java:99)       

In US, DST transition happened this year on 11th March at 01:59am,   
and thus the clocks were moved to 03:00am.So in US in year 2007 on March 11th,
the time from 02:00am - 02:59 are invalid, as the time jumps from 01:59am to
Especially when the dates are parsed in a non-lenient mode
(setLenient(false)).In non-lenient mode, strict        
adherence will be followed, and DST tranisition hour is considered to be
Hence it would benefit if it possible to change the JSTL <fmt:parseDate> tag to
set the lenient flag of the DateFormat object to 'true' -- or -- conversely 
provided a new tag attribute or setting to allow this behavior.
Comment 1 Henri Yandell 2009-07-10 00:32:35 UTC
This is an issue in the Standard taglib rather than DateTime, so changing accordingly.
Comment 2 Henri Yandell 2009-08-20 00:49:03 UTC
Something to decide here is whether this is something to report to the spec group.
Comment 3 Kris Schneider 2009-08-20 08:23:20 UTC
Per the JSTL spec (1.0, 1.1 and 1.2), section 9.10:

Parsing is non-lenient, i.e. the given date string must strictly adhere to the parsing format.

So, the spec would need to change before something like this could be implemented in the Standard taglib.