Is it possible to convert a java.util.TimeZone String
sun.util.calendar.ZoneInfo[id=\"America/Los_Angeles\",offset=-28800000,dstSavings=3600000,useDaylight=true,transitions=185,lastRule=java.util.SimpleTimeZone[id=America/Los_Angeles,offset=-28800000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
back to java.util.TimeZone object?
idout of this string and get a newTimeZoneobject from it. But it seems like an XY problem: why do you get a string like that anyway, and why can't you use the original object or a serialization of it or an easier to parse string?TimeZoneis one of the troublesome old date-time classes that are now legacy, supplanted by the java.time classes. See the classesZoneIdandZoneOffset.ZoneId.of(idString). Still easier if you got the originalTimeZoneobject:timeZoneObject.toZoneId().