如何检查DST和夏令时是在Android应用程序或关闭夏令时、是在、应用程序、DST

2023-09-03 22:51:10 作者:江风动客情

谁能告诉如何检查DST或日光节约时间的Andr​​oid应用程序或关闭

Can anybody tell how to check DST or Day Light Saving Time is on or off in android application

感谢

推荐答案

这会给你当前的DST偏移量。如果结果不为0,DST被激活

This will give you the current DST offset. If the result is not 0, DST is active.

int dstOffset = Calendar.getInstance().get(Calendar.DST_OFFSET);