在离线模式下获取当前日期 [英] Get current date In Offline Mode

查看:42
本文介绍了在离线模式下获取当前日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果设备日期不正确,如何获取实际日期?

How can I get the actual date if the device date is not accurate?

还有没有其他方法可以在没有网络的情况下在本地维护日期?

Is there any other way to maintain the date locally without network?

如果有人提出这个背后的确切想法,那将是很好的.

It would be great if any one suggests the exact idea behind this.

推荐答案

简单的答案是否".如果您无法访问NTP服务器或外部服务器来请求必须依靠设备的时间,那么就不可能这样做.尽管唯一的时间参考点是设备上设置的时间,但是您可以跟踪自打开应用程序以来经过了多少时间.

The simple answer is no. If you can't access an NTP server or an external server to request the time you have to rely on the device, it would be impossible to do otherwise. You can track how much time has passed since your app has opened although the only reference point for time is that set on the device.

重要的问题是,为什么准确的日期对您的应用至关重要?

The important question is why an accurate date is crucial to your app?

这篇关于在离线模式下获取当前日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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