• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Setting default timezone for Application

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Class TimeZone has a setDefault() method.
 
Something about .... going for a swim. With this tiny ad ...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic