Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
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");