2 Replies Latest reply on Jun 16, 2006 11:41 AM by Peter Farland

    WebServices and Timezones

      I have .NET web services that return arrays of xml objects, some of which include Date/Time values (i.e. birth date). I do not care about timezone for these values. The server services do not specify any timezone in their result, they send "2006-01-01T00:00:00". Flex 2 builds the objects propery but automatically adjusts any date/time values in the objects based on the diff between utc and the clients computer timezone.

      How can i turn this behavoir OFF? I do not want Flex to do anyting with timezones, my app hadles that were it cares. I just want flex to give me the exact date returned form the service.

      Please Help,

      - Kelly
        • 1. Re: WebServices and Timezones
          KellyIPZ Level 1
          I also have now noticed that when sending a date back to the web service it does exactly the opposit. Flex automatically adjusts the date in the other direction so it is UTC time that goes to the server. Again for storing date/time values that are not timestamps (like client birthdates) this is a big problem.

          If anyone knows how to turn this off or to set the "assumed" server time zone of the webservice please let me know.

          - Kelly
          • 2. Re: WebServices and Timezones
            Peter Farland Level 3
            Kelly, I replied to your flexcoders post with the following:

            The problem is that .NET returns the dateTime without timezone information, i.e. the value "1977-06-12T00:00:00" is missing the suffix for timezone data. If it returned "1977-06-12T00:00:00Z" or some other timezone info it would work fine. In XSD the absence of a timezone means the date/time is technically indeterminate by a significant range (+/- 14 hours for various DST worst cases I presume). Flex 2.0 interprets an XSD dateTime as an ActionScript Date in all cases - but without any timezone information it currently uses UTC to construct the date. We have a bug that asks us to consider a change to this behavior to assume the local client timezone when creating the date, but both of these solutions are technically arbitrary.

            Irrespective of Flex, ActionScript Dates are always displayed in the local timezone no matter what... there are various UTC helper methods to get information back in the UTC timezone.

            Your manual correction probably isn't working because you would have to take into account that the timezone-less dateTime has been interpreted in the UTC timezone but then on the default display of the Date it's in your local timezone. If you can't get .NET to include timezone information then for now I suggest sending a String back instead to avoid this complication.