Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个字符串myString = "Asia/kolkata";
myString = "Asia/kolkata";
我需要设置TimeZone.setDefault(myString);
TimeZone.setDefault(myString);
我已经尝试过如上所述。但不能在 TimeZone 参数中给出字符串。
这个怎么设置?
您用于TimeZone.getTimeZone(String)获取时区,然后您可以将其设置为默认值。
TimeZone.getTimeZone(String)