本文介绍了从网页中的Andr​​oid应用程序获取UTC日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要的 UTC日期作为我的Andr​​oid应用程序是设备(与用户)独立。我听到有些东西就像从NTP服务器获取日期,但无法找到谷歌或因此任何帮助。因此,谁能帮助我做一些code片段或链接。先谢谢了。

I want a UTC date for my android application which is device (and User) independent. I have heard some thing like getting date from NTP server but cannot find any help from google or SO. So can anyone help me with some code snippets or links. Thanks in advance.

注意:我不想UTC日期格式(如DateFormat.getTimeInstance()),但UTC时间,这用户不能更改

NOTE: I dont want UTC Date Format (like DateFormat.getTimeInstance();), but UTC time, which user cannot change.

推荐答案

谷歌发现了一个网络时间猎犬对我们来说,的。看看它的工作原理,但它甚至记录! :-O

Google found a network time retriever for us, SntpClient. See if it works, but it's even documented! :-O

它返回一个

这篇关于从网页中的Andr​​oid应用程序获取UTC日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 00:57