Assuming Brasilia GMT -0300: DST on 21/10/2012 at 00:00:00, when the clock should be advanced by one hour
Java
new Date(2012 - 1900, 9, 21, 0, 0, 0)
Sun Oct 21 01:00:00 BRST 2012
Chrome/FireFox (console)
new Date(2012, 9, 21, 0, 0 ,0)
Sat Oct 20 2012 23:00:00 GMT-0300 (Hora oficial do Brasil)
The result in Java is what I was expecting, but the result in JS I can not understand. I found this post where bjornd says
This is an absolutely correct behavior
but didn't explain why this behavior is OK.
My question is:
Why JS is returning a date one hour in the past?
P.S. I know Date is marked for "deprecation", but I'm using GWT; Date is my only option.