我使用此代码获取 2013 年 12 月 10 日和现在之间的时差(以秒为单位):
Time time_countdown = new Time();
time_countdown.set(10, 12, 2013);
Time time_now = new Time();
time_now.setToNow();
int constSecond = 1;
int constMinute = 60 * constSecond;
int constHour = 60 * constMinute;
int constDay = 24 * constHour;
long timeDifferense = time_countdown.toMillis(true) - time_now.toMillis(true);
int secondsDifferense = (int)(timeDifferense / 1000);
但差异是错误的