Locale ptBR = new Locale("pt", "BR");
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyy", ptBR);
SimpleDateFormat iso = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.sssZ");
GregorianCalendar calendar = new GregorianCalendar(ptBR);
String data = "31/12/1900";
calendar.setTime(sdf.parse(data));
iso.setTimeZone(calendar.getTimeZone());
System.out.println(iso.format(calendar.getTime()));
Output: 1900-12-31T00:00:00.000-0306
Does anyone know why the GMT returns -0306 instead of -0300?