Date now = new Date();
long timeInterval = now.getTime() - (15705 * 24 * 60 * 60 * 1000L);
long hours = timeInterval / (60 * 60 * 1000L);
LOG.debug(String.format("current date:%s, timeInterval:%d,hours:%d",now.toString(),timeInterval, hours));
システムが出力した結果 (15705 は 1970 年代からの日数を意味します):
12/12/31 22:06:47 DEBUG stat.TimeTest: 現在の日付:Mon Dec 31 22:06:47 CST 2012、timeInterval:50807153、hours:14
現在の時間は 21 時間ですが、結果は 14 時間と表示されます。