TimeZone.getAvailableIDs in Android and Java

2020-04-01 03:25发布

I am TimeZone.getAvailableIDs for List of TimeZone in android.It is behaving differently in android as compared to Java.

    String[] tzone = TimeZone.getAvailableIDs(-3 * 3600 * 1000);;
    for (String string : tzone) {
        do something
    }

It skiping all those TimeZone which don't include "/" character in android.Can anybody tell me what is the problem when we are using TimeZone in android.

标签: java android
2条回答
疯言疯语
2楼-- · 2020-04-01 03:34

While it is probably unexpected, I think it is doing the right thing. Those 3/4 letter timezones are so often ambiguous (no, I don't have an example at hand), while the long form with the / is unique.

查看更多
Melony?
3楼-- · 2020-04-01 04:01

That's expected according to Android Documentation:

Android does not support the deprecated three-letter time zone IDs used in Java 1.1.

查看更多
登录 后发表回答