java - GregorianCalendar time discontinuity between two days -


i tried compare number of ms between 2 dates , have problems specific dates. example 2015 february 1st:

system.out.println(new gregoriancalendar(2015, 01, 30, 12, 0, 0).gettimeinmillis()); system.out.println(new gregoriancalendar(2015, 01, 31, 12, 0, 0).gettimeinmillis()); system.out.println(new gregoriancalendar(2015, 02, 01, 12, 0, 0).gettimeinmillis()); 

this returns time in ms not ordered chronologically:

1425294000000  1425380400000  1425207600000 

i know how avoid problem using class (dateformat). not understand problem.

31st of february doesn't exist. month (2nd argument) of gregoriancalendar constructor 0-based index. [0-11]


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -