问题
I know I can feed VM arguments as follows
-Duser.timezone="Australia/Sydney"
Is there a programmatic way to do the equivalent? I would like the setting to be applied across the entire virtual machine.
回答1:
java.util.TimeZone.setDefault() can be used to set a default time zone to be returned by getDefault().
来源:https://stackoverflow.com/questions/7630753/how-do-i-programmatically-set-the-time-zone-in-java