如何检查DST和夏令时是在Android应用程序或关闭 [英] How to check DST or Daylight Saving time is on or off in android application
本文介绍了如何检查DST和夏令时是在Android应用程序或关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉如何检查DST或日光节约时间的Android应用程序或关闭
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);
这篇关于如何检查DST和夏令时是在Android应用程序或关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文