actionscript 3 - Flex - change in Timezone only picked up on Minutes Change. Why? -
i have timer running, every second, checks systems date/time, , updates date displayed on application.
if change system time, app updates next second. if change system timezone, app registers change when current minute changes.
i have little sample app shows problem occuring (if wish see yourself)
where call localdate:date = new date()
, localdate.timezoneoffset
not reflect current system timzone until current minute changes. if change system seconds, update on next timer tick
<?xml version="1.0" encoding="utf-8"?>
protected function windowedapplication1_creationcompletehandler(event:flexevent):void { mytimer = new timer(1000, 0); mytimer.addeventlistener(timerevent.timer, timerhandler, false, 0, true); mytimer.start(); } private function timerhandler( event:timerevent):void{ var localtime:date = new date(); offsetlabel.text = localtime.timezoneoffset.tostring(); secondslabel.text = localtime.seconds.tostring(); } ]]> </mx:script> <mx:label id="offsetlabel" x="33" y="24" width="223" height="58" fontsize="15"/> <mx:label id="secondslabel" x="33" y="90" width="223" height="58" fontsize="15"/>
Comments
Post a Comment