- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
2016 年土耳其政府决定保留 GMT+3 时区以节省夏令时,但在 Android 上:
Calendar calendar = Calendar.getInstance();
TimeZone tz = TimeZone.getTimeZone("UTC");
calendar.setTimeInMillis(timestamp * 1000);
Date currentTimeZone = (Date) calendar.getTime();
calendar.add(Calendar.MILLISECOND, tz.getOffset(calendar.getTimeInMillis()));
所以问题是;
它显示的是 11 月之前的 GMT+3:
2016 年 10 月 26 日星期三 18:00:00 GMT+03:00
但在 11 月之后:
2016 年 11 月 7 日星期一 20:00:00 GMT+02:00
它应该在 GMT+3 保持一整年,这是 TimeZone 的 android lib 的一个特殊问题还是我做错了什么?
谢谢,
更新
虽然我已经添加了对时区和 gmt 参数的检查,
对于使用土耳其时区的 Android 设备,情况会有点困惑,因为在 10 月 29 日之后设备的时间将比正常时间早一个小时,直到 Android 发布更新并用户应用该更新。
最佳答案
参见 release note of tzdb-database对于版本 2016g:
Release 2016g - 2016-09-13 08:56:38 -0700
Changes to future time stamps
Turkey switched from EET/EEST (+02/+03) to permanent +03,
effective 2016-09-07. (Thanks to Burak AYDIN.)
Use "+03" rather than an invented abbreviation for the new time.
显然,您的 Android 设备仍在使用过时的时区版本。实际上,您有以下选项可以继续:
TimeZone.getTimeZone("GMT+03")
关于Android TimeZone 土耳其 GMT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40262842/
2016 年土耳其政府决定保留 GMT+3 时区以节省夏令时,但在 Android 上: Calendar calendar = Calendar.getInstance(); TimeZone tz
浏览器上 JavaScript 中的日期计算问题。有 3 个参数 -从日期、天数和到日期 从使用 JavaScript 中的日历组件选择的日期 = 30/10/2016输入的天数 = 2 基于没有。应
有人可以帮忙解决以下问题吗? 我的操作系统是最新的 windows 10,时区是 (UTC+0300) Istanbul(夏令时已被移除,时区设置为 +0300 在土耳其的最新规定之后 - 2016
我是一名优秀的程序员,十分优秀!