Hi, I'm working on an application with Flex as front end. I need to interact with back end only with GMT+0 date times or with the same timezone which my server is set up on.
But as I've found out, any datetime instance created in Actionscript is by default will have the time zone set to system's local time zone. Also when this date is recieved on server as a result of time zone offset the date may skip a day or lag a day to what user has specified. Similar problem happens when recieving the date also, that is, any GMT +0 time which is received is converted to local time before displaying on the screen :(. Since i'm using DateField to get user input, any date chosen from DateChooser popup will be set to local time zone. Also the parseFunction property which can be set on a DateField is invoked only when the date is changed by typing manually into the text box, so we have no control over what is set through the DateChooser popup. Let me explain exactly what problem I am dealing with - Suppose the the server timezone is MST (GMT - 7) and the client machine is set on IST (GMT + 5:30), so there is a time difference of 12:30 hrs between the client and server. Now if a Date object is created and sent to server from the client machine any time before 12:30 PM (IST, say 11:00 AM on 22 May), flex gatway performs the time conversions according to the timezones of client and server and subtract 12:30 hrs from the time passed from the client and therefore the time goes to the previous day and the date received on the server is 21 May, 10:30 PM, which is not the date client has sent. So to resolve this issue, I want to set the timezone of the Date objects to what is there on the back end, so that no conversions take place while passing on the Date objects to the server. I know the Date object has timezone information relative to GMT and we can set the time to GMT time using Date.UTC(), but it does not change the timezone to GMT which will not serve the purpose. What I wanted to know if there is a way we can change the timezone of the Date object and if anyone has been able to do it (either with Flex 1.5 or 3.0)? If yes, could you please be generous enough to share the solution you appllied... Thanks

