Raj Raj - 1 year ago 89
Java Question

How to get local time of different time zones?

I want to get local time of different time zones using Java code. Based on the time zone passed to the function I need that time zone's local time. How to achieve this?

Answer Source
java.util.TimeZone tz = java.util.TimeZone.getTimeZone("GMT+1");
java.util.Calendar c = java.util.Calendar.getInstance(tz);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download