I want to represent midnight by java.util.Date class. To check this I output this value and obtain unexpected result.
The code follows:
Calendar calendar = new GregorianCalendar(1921, 4, 1, 0, 0);
Date date2 = calendar.getTime();
System.out.println(date2);
I obtain the following output:
Sun May 01 00:20:08 EET 1921
But I expect to obtain
Sun May 01 00:00:00 EET 1921
What is the cause of such behavior?
Currently I am testing my code in Europe/Helsinki timezone.