You have mixed up two concepts:
- You measure the time interval (the difference between two points in time)
- You print the date (one single point in time)
Both are incompatible, you will always get such strange effects. In your case, as indicated in other comments, the time zone is mixed. The concept of time zones exists only for dates (point in time), but does not make sense for intervals.
You can use the Jodatime library or the JSR 310 API: Date and Time (I think I think it is Java 8).
With Jodatime, you can explicitly plot the interval:
DateTime start = new DateTime(2004, 12, 25, 0, 0, 0, 0); DateTime end = new DateTime(2005, 1, 1, 0, 0, 0, 0); Period period = new Period(start, end);
and then format it using the PeriodFormatter parameter
PeriodFormatter daysHoursMinutes = new PeriodFormatterBuilder() .appendDays() .appendSuffix(" day", " days") .appendSeparator(" and ") .appendMinutes() .appendSuffix(" minute", " minutes") .appendSeparator(" and ") .appendSeconds() .appendSuffix(" second", " seconds") .toFormatter(); System.out.println(daysHoursMinutes.print(period));
By dividing the concepts of ONE moment in time and time between two points in time, you can make sure that there are no other surprises (for example, seconds of a jump).