• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Time zone problem

 
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I have a problem with the time zone in my program.
I need to use maritius timezone for my application, for that i have set my system's timezone to maritius
But when i execute this piece of code its just showing the IST in my code.



Do i miss anything while coding,
Please help me in this issue.

Thanks in Advance.
 
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
 
Gopi Chand Maddula
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ireneusz Kordal,

Thanks for your code.It helped me a lot and it worked fine.
But actually my doubt doesn't get clarified even doing this example.

As i already set my system timezone to Mauritius why is it not showing the default marituis timezone .
why should i set timezone separately in my code.

Does the calender interface consider system time or any other time?


Please clarify me in this issue....!
 
Marshal
Posts: 25798
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java runtime will get your timezone from the operating system. So, what is your operating system and how are you setting your timezone?
 
Gopi Chand Maddula
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:The Java runtime will get your timezone from the operating system. So, what is your operating system and how are you setting your timezone?



Hi,

Actually i am using Linux OS. Long back i have installed java in my system. In that particular time my Timezone is IST.
recently due to requirement i have changed my system's Timezone to Mauritius.

and tried the above code for getting the Mauritius timezone.

But still it gave output as IST. So i am very confused about that. Upto my knowledge i know that java program will take system time as reference, after changig the timezone in my system also it is showing the older timezone only.

Please clarify this
Thanks in Advance
 
Gopi Chand Maddula
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any one know solution for this.....?
Please help me this. I want to get clarified in this issue...!
 
That feels good. Thanks. Here's a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic