Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
TimeZone conversion in Java - WebService Dates
Hello,
We have a WebService written in Java and we would like to send the following soap for a date:
2012-02-03T14:15:00.000-03:00
For some reason the application is generating:
2012-02-03T06:15:00.000Z
If you have a piece of code that help us I would appreciate that.
The piece of code (we tried with 3 options but are generating the "Z"):
//OPTION 1
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
cal.setTimeZone(TimeZone.getTimeZone("AGT"));
cal.setTime(sdf.parse(customF.getValor()));// all done
//OPTION 2
String calendarioAFormatear = ISO8601.fromCalendar(cal);
Calendar calendario = ISO8601.toCalendar(calendarioAFormatear);
//OPTION 3
DateTime dateTime = new DateTime("2012-02-03T14:15:00.000-03:00");