计算时差的Android [英] Calculate Time Difference in Android
问题描述
我是新的Android.I找不到任何方法来计算时间difference.So请帮助我。我设计了一个简单的应用程序。在这个程序予了3 EditTexts和在这些的EditText欲输入的登录时间和注销时间然后在数据库存储这些值,而在第三的EditText我想显示这两个时间之间的差。
I am new in Android.I can't find any way to calculate the time difference.So please help me. I designed a simple application. In this program I took 3 EditTexts and in these EditText I want to input the login time and logout time then store these values in the Database, And in the 3rd EditText I want to display the difference between these two time.
推荐答案
您可以使用标准的Java API调用:
You can use standard Java api calls:
System.nanoTime()
System.currentTimeMillis()
此外,检查这些 2 <一href="http://stackoverflow.com/questions/1198068/android-java-util-calendar-time-difference">links用于计算时间差。
Also, check out these two links for calculating time difference.
这篇关于计算时差的Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!