Got a strange weirdness when using Date
s and Calendar
. Point is I want to create a specific date e.g.
Calendar cal = Calendar.getInstance();
cal.set(1970, 0, 1, 0, 0, 0);
Date date = cal.getTime();
Now the thing is: it shows the correct date, but when debugging I see under the date-variable a "fasttime" of e.g. -3599459
. This makes my JUnit
tests fail, because the expected value is -3600000
.
It seems the Calendar adds 541 milliseconds or something like when initializing...
Question is: is it not possible to simply create a fixed date without this 'i'm adding some milliseconds in the background'-ghost function?