My application uses many dates.  Dates are always passed between the 
back end web service and the front end flex app as timestamps, 
milliseconds since epoch.  Yesterday I switched to a dev. box that is 
running VISTA... now all of the dates in my application are off by the 
timezoneOffset.  I can correct them easily enough as follows:

         var millis:Number = d.time;
         var offsetMillis = d.timezoneOffset * 60 * 1000;
         d.time = millis + offsetMillis;

But, I am not sure that this is the right thing to do.  I went back and 
checked my XP machine setup and verified that it was using the correct 
timezone, and it was.  So... why would this behave differently?  The 
behavior seems to be dictated by the OS that the .swf file was built on 
(or the flex sdk compiler that was used) and not by the OS that the 
flash player is running on.  I verified this by accessing a site running 
a .swf that I built on XP from both systems... that one handled dates as 
I expected (no manual TZ adjustment needed).  Then I accessed a site 
running a .swf that I built on my vista box from an XP client and an 
vista client.  Both exhibited the need for a time zone correction.

Can anybody tell me what is expected here?  Should I adjust for timezone 
as above every place in my code where I create dates?  Any help is 
appreciated.

Scott

Reply via email to