wood burning stoves 2.0*
The moose likes Java in General and the fly likes Setting default timezone for Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Setting default timezone for Application" Watch "Setting default timezone for Application" New topic
Author

Setting default timezone for Application

raja patil
Greenhorn

Joined: May 26, 2008
Posts: 24
hello,

this is in continuation of other thread "puzzling Parsing Of dates"
while dissecting above problem I saw recommendations to have
application's default Timezone to tackle date time processing and persistence
issues. The idea is let application be hosted on server in any time zone
it will have fixed time zone so that all dates and times are persisted and
retrieved wrt specific time zone context.

If anybody differs with this your comments are welcomed and are valuable to me.

But I also came to know that application specific timezones can not be set but
I have to set timezone for entire JVM i.e. for all the applications using that JVM.

its suggested that JDK should be started with -Duser.timezone="<tz to set>"

I am using Spring, blazeDS, spring-security, spring-flex and iBatis at backend
so I am not starting JVM manually. So How can i use this parameter to set default timezone of "GMT+0530"
please guide me where shall i put this so that JVM uses this timezone by default.

Thanks and regards

Raja
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Class TimeZone has a setDefault() method.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Setting default timezone for Application
 
Similar Threads
want client's time zone from server side
TimeZone conversion in client/server architecture
problem with new Date()
want client's time zone from server side
set JVM timezone in Linux