File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Time zone problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Time zone problem" Watch "Time zone problem" New topic
Author

Time zone problem

Gopi Chand Maddula
Ranch Hand

Joined: May 11, 2010
Posts: 40


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

Joined: Jun 21, 2008
Posts: 423
Try this:
Gopi Chand Maddula
Ranch Hand

Joined: May 11, 2010
Posts: 40

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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: May 11, 2010
Posts: 40

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

Joined: May 11, 2010
Posts: 40

Does any one know solution for this.....?
Please help me this. I want to get clarified in this issue...!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Time zone problem