AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need Systerm Property user.timezone to be manipulated

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
Megha Vishwanath
Guest





PostPosted: Thu Jan 13, 2005 12:25 pm    Post subject: Need Systerm Property user.timezone to be manipulated Reply with quote



Hi,

A jdk installation on my machine has picked up the time zone
Asia/Rangoon

My time zone is actually Asia/ Calcutta

Apparently, j2sdk1.4.2_05 does not even support Asia/Rangoon- MMT that
gets set by default to GMT.
ie., TimeZone tz=TimeZone.getTimeZone(MMT); tz.getDisplayName() is GMT

I have been trying to manipulate the timezone by setting the
user.timezone system property through this piece of code-

--------------------------------------------------------------------------------
Calendar cal = Calendar.getInstance();

System.out.println("n TIME ZONE :"+
cal.getTimeZone().getDisplayName());
System.out.println("n TIME :"+ cal.getTime().toGMTString());
System.out.println("n user.timezone:
"+System.getProperty("user.timezone"));
System.out.println("n user.country:
"+System.getProperty("user.country"));
System.out.println("njava.home: "+System.getProperty("java.home"));

System.setProperty("user.timezone","Asia/Calcutta");


System.out.println("nuser.timezone:
"+System.getProperty("user.timezone"));
System.out.println("n New Time Zone:
"+TimeZone.getDefault().getDisplayName());

--------------------------------------------------------------------------------
The user.timezone only temporarily gets set only for the lifetime of
the program.
How can I permanantly change this value? Please help.

-Thanks
Megha.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.