Google Glass Time [英] Google Glass Time
本文介绍了Google Glass Time的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有办法以语法方式获取Google Glass的时间?我正在使用System.currentTimeMillis();但是它给了我一个非常长的数字,例如:1403101657961.我想要用户打开Glass时正在查看的实际时间.谢谢.
Is there a way to get the time in Google Glass pro grammatically? I am using System.currentTimeMillis(); but it gives me a really long number such as: 1403101657961. I want the actual time that the user is looking at when he turns on Glass. Thanks.
推荐答案
You can use the class SimpleDateFormat to format your time to Date.
使用Millisec创建日期:
Create a date with your millisec :
Date date= new Date(System.currentTimeMillis());
然后使用SDF对其进行格式化
then format it with SDF
new SimpleDateFormat(""yyyy.MM.dd G 'at' HH:mm:ss z").format(date)
这篇关于Google Glass Time的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文