[opencms-dev] Timezone and DST problems in OpenCms-based system

Jonathan Woods jonathan.woods at scintillance.com
Sat Sep 9 09:14:31 CEST 2006


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.
 
I'm getting inconstent date formatting results on my 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.
 
// Test using instance in time which is largely arbitrary but occurs
// during UK's daylight savings time:
 
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm z", Locale.UK);
sdf.format(new Date(1157782813701));
 
>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().
 
Anyone got any ideas?
 
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060909/f7f9079a/attachment.htm>


More information about the opencms-dev mailing list