2 Replies Latest reply on Jul 2, 2009 2:54 AM by home_aidan

    Using new Date on Linux is diffrent to windows/mac????

    home_aidan Level 1

      Hi,

      Im getting two diffrent results when using date when using either windows / linux

       

      The windows output should be      Wed Jul 1 16:15:12 GMT+0100 2009

       

      When i run this code on linux I get  Wed Jul 1 16:15:12 GMT-0400 2009

       

      Does anyone know why this is and how i can correct it so its the same as windows?

      Example working as below....

      http://www.aidanmack.co.uk/flex/test/test.html

       

      CODE BELOW,

       

       

      Thanks for any help.

       

      Cheers

        Aidan

       

       

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="figureTimeDif('2009-07-01 16:15:12');">

      <mx:Script>

      <![CDATA[

        [Bindable]public var betplacedtimedate:Date

       

       

      public function figureTimeDif(betsliptaken:String):void{

      var thedate:String = betsliptaken;

      var dateBit:String = thedate.split(" ")[0]

      var timeBit:String = thedate.split(" ")[1]

      var dateBits:Array = dateBit.split("-");

      var timeBits:Array = timeBit.split(":");

      betplacedtimedate = new Date( dateBits[0], dateBits[1]-1, dateBits[2],timeBits[0],timeBits[1],timeBits[2])

      }

      ]]>

      </mx:Script>

      <mx:VBox>

       

      <mx:Text  htmlText="==============================================================================" />

      <mx:Text  htmlText="{betplacedtimedate}"/>

      </mx:VBox>

      </mx:Application>