Java Convert GMT/UTC to Local time doesn't work as expected
问题 In Order to show a reproducible scenario, I am doing the following Get the current system time (local time) Convert Local time to UTC // Works Fine Till here Reverse the UTC time, back to local time. Followed 3 different approaches (listed below) but all the 3 approaches retains the time in UTC only. { long ts = System.currentTimeMillis(); Date localTime = new Date(ts); String format = \"yyyy/MM/dd HH:mm:ss\"; SimpleDateFormat sdf = new SimpleDateFormat (format); // Convert Local Time to UTC