如何检查DST和夏令时是在Android应用程序或关闭 [英] How to check DST or Daylight Saving time is on or off in android application

查看:650
本文介绍了如何检查DST和夏令时是在Android应用程序或关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能告诉如何检查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);

这篇关于如何检查DST和夏令时是在Android应用程序或关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆