Bug 27201 - <fmt:formatDate problem with daylight savings time
Summary: <fmt:formatDate problem with daylight savings time
Status: RESOLVED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-24 21:33 UTC by Riaan Oberholzer
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Riaan Oberholzer 2004-02-24 21:33:52 UTC
I have an application that runs in The Netherlands, but is operated from 
England. Date/times are thus stored and converted with a dateformatter set 
with the Timezone "Europe/London". It looks fine. Ie, from a JSP with an input 
form, I enter a time as "15:00" (text, UK time) and in the database it 
shows "16:00" (Dutch time, after using dateformatter and timezone) which is 
expected.

Reading and displaying it back also works, EXCEPT when I use JSTL and 
<fmt:formatDate timeZone="Europe/London" ... When daylight savings kick in 
(start of April I think), the times are showed 1 our behind when displaying it 
with JSTL. When formatting it manually with my dateformatter, it is correct 
again. Ie, I enter a time as "15:00", it shows in the DB as "16:00", but JSTL 
shows it as "14:00". Formatting 'manually' shows the correct 15:00 time. Is 
this a bug? Or is there something else I need to do to get this right? Thanks
Comment 1 Riaan Oberholzer 2004-02-24 21:35:05 UTC
Btw, I use JSTL 1.0.5, latest version thus.
Comment 2 Pierre Delisle 2004-02-26 00:45:57 UTC
Riaan,

Could you provide us with a simple test case to reproduce the
problem. I got lost somewhere between 14:00, 15:00, and 16:00 :-).
Comment 3 Riaan Oberholzer 2004-02-26 07:36:49 UTC
Apologies:

<fmt:formatDate value="${row.TIME}"
                timeZone="<%= Constants.TIMEZONE %>" 
                pattern="dd-MM-yyyy 'at' HH:mm"/>
 
does not work
 
<fmt:formatDate value="${row.TIME}"
                timeZone="Europe/London" 
                pattern="dd-MM-yyyy 'at' HH:mm"/>
 
does.
( Constants.TIMEZONE  = "Europe/London")

Someone commented:
 
> So the java scriplet <%= xxx %> is not allowed?

It depends. If you're on a JSP 2.0 container (JSTL 1.1), then this 
works. It won't on a JSP 1.2 container (JSTL 1.0). 

In JSTL 1.0, you need to use the RT libraries to 
use rtexprvalues. See the spec for details.
Comment 4 Felipe Leme 2004-02-26 17:30:12 UTC
Riaan,

We need a more complete test, like a page that sets the date object using
scriplet code and then display the results using JSTL.

For instance, you said that you enter the time from a JSP page, save it in the
database and then display using JSTL. If you could write a simple version of
this process, like a jsp page that writes to memory (instead of database) and
another that reads the same memory but displaying the wrong data, we could
reproduce it and isolate the bug.

Felipe

OOPS: nevermind, just now I realized you mark this bug as invalid...