tags:

views:

137

answers:

2

I've been searching for a definitive answer to this, and the XML schema data types document seems to suggest that timezones are accepted, yet I found at least one implementation which does not properly convert time zones ( NUSOAP ).

To make sure that the problem is not at my end, I'd like to know if a format such as 2009-11-05T11:53:22+02:00 is indeed valid and should be parsed with timezone information, i.e. as 2009-11-05T13:53:22.

+2  A: 

You converted the timezone incorrectly.

2009-11-05T11:53:22+02:00

is equivalent to

2009-11-05T09:53:22Z

Is that what NUSOAP did?

Jeremy Stein
Sorry, I gave a bad example. The nusoap issue is the following: I send e.g. `2015-10-29T12:59:14Z` which corresponds to a timestamp of `1446116354` , but with when parsing with `mci_iso8601_to_timestamp` I get a timestamp of `1446123554`, which is exactly my time zone's offset from UTC. I'm simply trying to find out if it's me or nusoap.
Robert Munteanu
`mci_iso8601_to_timestamp` is giving you the correct answer. `2015-10-29T12:59:14Z` is `1446123554`. The `Z` at the end means UTC. If you want to specify your own timezone, you have to give it `2015-10-29T12:59:14+02:00`, which is equivalent to `2015-10-29T10:59:14Z`, which is `1446116354`.
Jeremy Stein
+2  A: 

Given the following sentences from the w3c schema documentation:

"Local" or untimezoned times are presumed to be the time in the timezone of some unspecified locality as prescribed by the appropriate legal authority;

and

When a timezone is added to a UTC dateTime, the result is the date and time "in that timezone".

it does not sound like there is a definitive answer to this. I would assume that it is the usual ambiguity: Both versions are principally valid, and the question of what version to use depends on the configuration/behavior/expectations of the system one is interfacing with.

And even if there where a definitive answer, I would definitely not rely on it, but rather expect that every other web service and library had its own way of dealing with this :/

Henrik Opel