struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Gordon <adam.gor...@readytalk.com>
Subject Re: fmt:formatDate question...
Date Thu, 07 Sep 2006 14:55:38 GMT
Ok, after some heavy digging, here's the deal:

Support for abbreviations is only kept around for compatibility for Java 
1.1.x and apparently AEDT is not a standard time zone abbreviation 
(though I bet Sydney residents would beg to differ...).  It appears that 
the preferred time zone string format for Java is Country/City, so 
Australia/Sydney in this case...

The time zones currently supported by Java can be found in the lib/zi 
sub-directory of your JRE installation directory - they're binary files 
so don't try to read them...

Perhaps the reason Java supports American time zones is that Sun is an 
American company?  (In the words of Mel Brooks, "It's good to be the 
king...")

-adam

Adam Gordon wrote:
> Ok, so not specifically a Struts question, but anway...
>
> I'm using the fmt:formatDate element in a JSP and it appears that when 
> the value of my "pattern" attribute includes "zz" (the time zone, my 
> full format is "hh:mm a zz") then for US time zones (e.g. PST, PDT, 
> MST, MDT, etc...) then the same shows up in my rendered string in the 
> web page.  If, however, I use a Calendar object whose time zone is 
> say, AEDT (Australian Eastern Daylight Time) then "GMT" is rendered 
> instead.
>
> It's not doing a date/time conversion because the timestamp that was 
> pulled from the Calendar object is what I had originally set it as and 
> not GMT+11, the GMT offset for AEDT.
>
> It's not crucial that I have this since I can just remove the "zz" and 
> put my time zone string in its place, but I'm curious as to why it's 
> not inserting the right time zone.
>
> Anyone have any ideas?  I'm running Kubuntu (dapper) and I tried 
> setting /etc/timezone to America/Denver and Australia/Sydney (via the 
> control panel) but the behavior is the same - it's really weird.
>
> Thanks,
>
> -adam
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message