Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Time zone problem

 
Gopi Chand Maddula
Ranch Hand
Posts: 40
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.
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
 
Gopi Chand Maddula
Ranch Hand
Posts: 40
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....!
 
Paul Clapham
Sheriff
Pie
Posts: 20713
30
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: 40
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: 40
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...!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic