2 Replies Latest reply on Jul 2, 2007 9:38 AM by paulo.larini

    Date Timezone question

    paulo.larini
      In this example:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="absolute">
      <mx:Script>
      <![CDATA[
      private function pegarHorarios():Array {
      var h:Array= new Array;
      var hs:Number=8 * 60; //arrumar o utc pois 8:00 virou 9:00
      var he:Number=18 * 60;
      var interval:Number = 30;
      var startHour:Date=new Date(2000, 0, 1, 0, 0, 0, 0);
      var hour:Date=new Date();
      var obj:Object=new Object;
      while (hs <= he) {
      hour.setTime(startHour.getTime() + hs * (1000*60));
      obj=new Object;
      obj['label'] = timeFormatter.format(hour); //
      h.push(obj);
      hs=hs + interval;
      }

      return h;
      }
      ]]>
      </mx:Script>
      <mx:DateFormatter id="timeFormatter" formatString="YYYY-MM-DD HH:NN"/>
      <mx:ComboBox dataProvider="{pegarHorarios()}"/>
      </mx:Application>


      My intention is to get a combo with hours from 8:00 to 18:00, but it begins with 9:00.
      What´s the problem?