How can i convert time zone string to the TimeZone Object in java?
问题 I hava serval time zone strings in utc format, such as "UTC+08:00", "UTC-05:00", the question is how can i convert these utc format strings to the TimeZone Object(java.util.TimeZone) in java? i have tried to convert by zoneId as follows, but did not work: ZoneId zoneId = ZoneId.of("UTC+08:00"); TimeZone timeZone = TimeZone.getTimeZone(zoneId); i know TimeZone timeZone = TimeZone.getTimeZone("Asia/Shanghai"); would work, but i do not know the mapping between "UTC+08:00" and "Asia/Shanghai" 回答1