Watch out the milliseconds in java Calendar

milliseconds  problem If you run the following test multiple times, you get different results: result : Time 1369454400208 Time 1369454400185 Time 1369454400926 When getting Instance of calendar it has been initialized with current time. And when setting year,month etc. MILLISECOND were taken from current date. What’s more if you get a calendar instance and  use…