我有一個鬧鐘應用程序,我將鬧鐘存儲到數據庫中。所有的警報工作正常,數值(毫秒)存儲爲正確的數字。現在我試圖從我的數據庫中顯示這些時間。和我使用一個日曆中檢索的時間在時間格式:Android日曆顯示錯誤時間
Calendar calendar = Calendar.getInstance();
SimpleDateFormat timeformat = new SimpleDateFormat("HH:mm");
milis = c.getInt(2);
calendar.setTimeInMillis(milis);
vreme = timeformat.format(calendar.getTime());
listavreme.add(vreme);
Milis取出作爲從Cursor
(測試),但是當我顯示在HH的getTime()
右邊的數字:mm格式是總是顯示一小時。因此,如果milis值爲:61200000(17:00),日曆顯示爲18:00。我無法弄清楚。
謝謝你是對的! – user1880779
你好:-) –