I have the following code in Java
import java.text.SimpleDateFormat;
import java.util.Calendar;
public class Test {
public static void main(String[] args) {
try {
SimpleDateFormat SDF = new SimpleDateFormat("YYYY-MM-dd'T'HH:mm:ss");
Calendar date = Calendar.getInstance();
date.setTime(SDF.parse("2011-02-01T00:00:00"));
System.out.println(SDF.format(date.getTime()));
} catch (Exception e) {
}
}
}
I expect to see in the console the following string
2011-02-01T00:00:00
instead I see
2011-12-26T00:00:00
What can be wrong?