|Summary:||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)|
|Product:||Taglibs||Reporter:||Anuradha Natarajan <anuradhn>|
|Component:||Standard Taglib||Assignee:||Tomcat Developers Mailing List <dev>|
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) at org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport.doEndTag(Unk 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 03:00am. 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 invalid 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.