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