How I can get available timezones (android:settings)

后端 未结 4 1249
余生分开走
余生分开走 2021-01-18 06:16

I want to get TimeZones, that I can see in settings: Date and Time -->

4条回答
  •  礼貌的吻别
    2021-01-18 07:12

    String[]TZ = TimeZone.getAvailableIDs();
            ArrayList TZ1 = new ArrayList();
            for(int i = 0; i < TZ.length; i++) {
                if(!(TZ1.contains(TimeZone.getTimeZone(TZ[i]).getDisplayName()))) {
                    TZ1.add(TimeZone.getTimeZone(TZ[i]).getDisplayName());
                }
            } 
    

    I think this one is help you

提交回复
热议问题