Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
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");