Java detect Time Zone after host OS default is modified

前端 未结 2 1405
一向
一向 2021-01-18 12:49

I have a simple Java Executor thread running. This just detects the time zone and displays.

The code is as follows :

ScheduledExecutorService exec =         


        
2条回答
  •  深忆病人
    2021-01-18 13:30

    Executing the following code resets the time zone to the updated system value:

        System.setProperty("user.timezone", "");
        TimeZone.setDefault(null);
    

提交回复
热议问题