Reputation: 1954
I am having a String myString = "Asia/kolkata";
I need to set TimeZone.setDefault(myString);
I have tried as mentioned above. But String cannot be given in TimeZone parameter.
How to set this?
Upvotes: 5
Views: 5657
Reputation: 1500675
You use TimeZone.getTimeZone(String)
to get the time zone, then you can set that as the default.
Upvotes: 11