You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Raymond <pp...@hotmail.com> on 2005/03/14 05:01:32 UTC

does Locale detection affect webapp's default TimeZone?

Hi Tapestry users,

Another strange bug is happening with our production Tapestry app (never happened in testing environment). All the datetime values produced by new Date() or Calendar.getInstance().getTime() should always give the datetime values of my server's TimeZone (GMT+8), but the application log showed that after some period of running (usually 2 days) all the datetime value would suddenly change to UTC time. And then the application went weird because of all the datetime calculations going wrong.

I know that when a user first connect to the app Tapestry would automatically determine the user's Locale by analyzing the request headers sent by the browser. (I found this works for IE but not Mozilla!) Does the Locale only affect lingual stuffs? Would it somehow affect the default TimeZone of the application thereby affecting the datetime values other users see?

Another possibility is that it might be a Tomcat problem because when it happened we could not shutdown Tomcat normally other than using kill -9. Not sure if the 2 events are related.

Anyway thanks for your kind help.
Raymond

Re: does Locale detection affect webapp's default TimeZone?

Posted by Hanson Char <ha...@gmail.com>.
Don't know the reason, but it appears that the only effect a Locale
has on Calendar is the firstDayOfWeek and minimalDaysInFirstWeek, but
other than that it shouldn't affect the GMT offset.  See below the
javadoc extracted from the Calendar class.

H

    /**
     * Both firstDayOfWeek and minimalDaysInFirstWeek are locale-dependent.
     * They are used to figure out the week count for a specific date for
     * a given locale. These must be set when a Calendar is constructed.
     * @param desiredLocale the given locale.
     */


On Mon, 14 Mar 2005 12:01:32 +0800, Raymond <pp...@hotmail.com> wrote:
> Hi Tapestry users,
> 
> Another strange bug is happening with our production Tapestry app (never happened in testing environment). All the datetime values produced by new Date() or Calendar.getInstance().getTime() should always give the datetime values of my server's TimeZone (GMT+8), but the application log showed that after some period of running (usually 2 days) all the datetime value would suddenly change to UTC time. And then the application went weird because of all the datetime calculations going wrong.
> 
> I know that when a user first connect to the app Tapestry would automatically determine the user's Locale by analyzing the request headers sent by the browser. (I found this works for IE but not Mozilla!) Does the Locale only affect lingual stuffs? Would it somehow affect the default TimeZone of the application thereby affecting the datetime values other users see?
> 
> Another possibility is that it might be a Tomcat problem because when it happened we could not shutdown Tomcat normally other than using kill -9. Not sure if the 2 events are related.
> 
> Anyway thanks for your kind help.
> Raymond
>

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