We would like to know how to convert TimeZone to ZoneId.
/* w w w . java2s . c o m*/ import java.time.ZoneId; import java.util.TimeZone; public class Main { public static void main(String[] args) { // TimeZone to ZoneId ZoneId defaultZone = TimeZone.getDefault().toZoneId(); System.out.println(defaultZone); } }
The code above generates the following result.