0

I am working with Netsuite library which was generated from WSDL. As a result, the JARs generated from WSDL only accept Calendar.

Deep inside this is the xsd:

http://books.xmlschemata.org/relaxng/ch19-77049.html

As specified:

The time zone may be specified as Z (UTC) or (+|-)hh:mm.

Now I want to actually set a timezone to PST time, However, I do not understand, how I can pass on time-zone information when my Netsuite WSDL only accepts Calendar.

   Calendar calendar = Calendar.getInstance();
    calendar.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));

This above code did not work, since XML somehow did not do a -07.00

Note: This link Convert Java Date into XML Date Format (and vice versa) did not help. Dates are confusing concept to me.

JavaDeveloper
  • 5,320
  • 16
  • 79
  • 132
  • 3
    If the generated API you're calling only accepts a `Calendar` object, and you've given it a `Calendar` object with a defined time zone, and it doesn't generate time zone suffix in the XML, then it's ignoring the time zone, and there is nothing you can do about it, other than using a different WSDL library, or informing the WSDL library that you want time zones generated. Not knowing which WSDL library you're using, we can't help with that. – Andreas Sep 03 '19 at 21:28
  • Is the offset of -07:00 important? If I take the name from your link, *Instant of time*, literally, it shouldn’t be since as far as I know setting the time zone or offset of a `Calendar` doesn’t change the instant of time. Other question: what is shown instead? Other than that I’m surprised that what you already did doesn’t seem to work. – Ole V.V. Sep 04 '19 at 06:56

0 Answers0