<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006>This shows how little l10n/i18n I've done... please
only read on if you're similarly inexperienced.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006>The answer:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006>1. Constructing a DateFormat uses the system's
timezone by default, and no timezone is guessed from the Locale used - nor could
it be, in general.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006>2. You can use DateFormat.setTimeZone() to set a
specific timezone, whereupon dates will be formatted
accordingly.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006>3. The so-called timezone rendered by a
SimpleDateFormat with the format string "z" is not in fact the timezone,
but a String describing to the time representation scheme in use given the
timezone and (for SimpleDateFormat with a timezone which uses Daylight Savings
Time) the time too. So for a SimpleDateFormat whose timezone has been set
to "Europe/London" (which is what I had to use), the timezone part of the
formatted String is "BST" for a summer time and "GMT" for a winter time.
Here "GMT" is the identifier for the timezone representation scheme, which isn't
the same thing as the identically named timezone.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=773222009-09092006>Jon</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Jonathan
Woods<BR><B>Sent:</B> 09 September 2006 08:15<BR><B>To:</B> 'The OpenCms mailing
list'<BR><B>Subject:</B> [opencms-dev] Timezone and DST problems in
OpenCms-based system<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>OK, I admit it: this
is a slightly off-topic question, but it's about an issue which I imagine might
have affected many OpenCms developers.</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>I'm getting
inconstent date formatting results on my </FONT></SPAN><SPAN
class=823052805-09092006><FONT face=Arial size=2>UK-based Windows development
box and my US-based Linux/CentOS server running OpenCms. It seems that the
Linux box is ignoring daylight savings time settings for a
Locale.</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>// Test using
instance in time which is largely arbitrary but occurs</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>// during UK's
daylight savings time:</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>SimpleDateFormat sdf
= new SimpleDateFormat("HH:mm z", Locale.UK);</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>sdf.format(new
Date(1157782813701));</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2></FONT></SPAN><SPAN
class=823052805-09092006><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>From the US machine,
I get a time in GMT; on the UK machine, I get a time in BST, which is the GMT
daylight savings time zone. BST is the correct result for this Date
value. Both machines are using JDK 1.5.0_08, and as it happens the system
clocks on the two machines are roughly the same according to new
Date().getTime().</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2></FONT></SPAN><SPAN
class=823052805-09092006><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial size=2>Anyone got any
ideas?</FONT></SPAN></DIV>
<DIV><SPAN class=823052805-09092006></SPAN> </DIV>
<DIV><SPAN class=823052805-09092006><FONT face=Arial
size=2>Jon</FONT></SPAN></DIV></BODY></HTML>