How to change default time zone used for formatting timestamps ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to change default time zone used for formatting timestamps ?

Sébastien Launay
Hi,

Just a tip because the time zone used in my installation is GMT and
it's not the right one for my location.
I do not find a way to configure this and read timestamps with one
hour late just keeps annoying me :p.

So, in order to change the default time zone used for formatting
time stamps, you can use a feature of Jelly by setting the following
system property while starting your servet engine :
-Dorg.apache.commons.jelly.tags.fmt.timeZone=XXX
where XXX is a java TimeZone ID ("Europe/Paris" for example).

--
Sébastien LAUNAY

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to change default time zone used for formatting timestamps ?

Kohsuke Kawaguchi
Administrator
Sébastien Launay wrote:

> Hi,
>
> Just a tip because the time zone used in my installation is GMT and
> it's not the right one for my location.
> I do not find a way to configure this and read timestamps with one
> hour late just keeps annoying me :p.
>
> So, in order to change the default time zone used for formatting
> time stamps, you can use a feature of Jelly by setting the following
> system property while starting your servet engine :
> -Dorg.apache.commons.jelly.tags.fmt.timeZone=XXX
> where XXX is a java TimeZone ID ("Europe/Paris" for example).
Normally, this isn't supposed to be necessary --- for example my server
runs on GMT-8:00 (or AKA PDT), and I get to see time in PDT without
doing anything like that.

To the best of my knowledge, Java is supposed to know the time zone it's
in (I guess it obtains that in OS-specific way), and Jelly picks that up
from there. So it seems like your JVM is not correctly picking up the
current time zone.

Go to http://server/hudson/systemInfo and see "user.timezone" system
property.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to change default time zone used for formatting timestamps ?

Sébastien Launay
Kohsuke Kawaguchi a écrit :

> Sébastien Launay wrote:
>> Hi,
>>
>> Just a tip because the time zone used in my installation is GMT and
>> it's not the right one for my location.
>> I do not find a way to configure this and read timestamps with one
>> hour late just keeps annoying me :p.
>>
>> So, in order to change the default time zone used for formatting
>> time stamps, you can use a feature of Jelly by setting the following
>> system property while starting your servet engine :
>> -Dorg.apache.commons.jelly.tags.fmt.timeZone=XXX
>> where XXX is a java TimeZone ID ("Europe/Paris" for example).
>
> Normally, this isn't supposed to be necessary --- for example my
> server runs on GMT-8:00 (or AKA PDT), and I get to see time in PDT
> without doing anything like that.
>
> To the best of my knowledge, Java is supposed to know the time zone
> it's in (I guess it obtains that in OS-specific way), and Jelly picks
> that up from there. So it seems like your JVM is not correctly picking
> up the current time zone.
>
> Go to http://server/hudson/systemInfo and see "user.timezone" system
> property.
>
Indeed the JVM is not correctly picking up the right timezone,
user.timezone tells me that the user timezone is GMT+1 but i
need Europe/Paris which is GMT+2.

What i do not understand, it's that the unix date command returns
the right time stamp (GMT+2).

So, |java -Duser.timezone=Europe/Paris will work as well.

My environment is GNU/Linux Ubuntu 7.04 Server and Sun JVM 1.5.0_11-b03.

Although my environment is a little broken, this tip may still be useful if
a user has a hudson instance running in a different location than the user
location (for example : server in NY with others applications and users
in LA).
|

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to change default time zone used for formatting timestamps ?

Kohsuke Kawaguchi
Administrator
2007/10/10, Sébastien Launay <[hidden email]>:
> Although my environment is a little broken, this tip may still be useful if
> a user has a hudson instance running in a different location than the user
> location (for example : server in NY with others applications and users
> in LA).

Indeed. Would you be interested in capturing this in Wiki? I think
this is an interesting tip.


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to change default time zone used for formatting timestamps ?

Sébastien Launay
Kohsuke Kawaguchi a écrit :

> 2007/10/10, Sébastien Launay <[hidden email]>:
>  
>> Although my environment is a little broken, this tip may still be useful if
>> a user has a hudson instance running in a different location than the user
>> location (for example : server in NY with others applications and users
>> in LA).
>>    
>
> Indeed. Would you be interested in capturing this in Wiki? I think
> this is an interesting tip.
Done.
http://hudson.gotdns.com/wiki/display/HUDSON/Change+time+zone

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]