1 Reply Latest reply on Nov 22, 2010 10:19 AM by saisri2k2

    Date manipulation in Flex?

    ShedoSurashu

      I've found out how to get the UNIX time in Flex. I do it using a public function.


                  public function getUnixTime():String{
                      var myDate:Date = new Date();
                      var unixTime:Number = Math.round(myDate.getTime()/1000);
                      return unixTime.toString();
                  }

       

      So far it does what what I want it to do. But now I wanted to know, is it possible to get the readable date counterpart of a given UNIX timestamp? If so, how?

       

      E.g.:

      1236268800 converts to Thu Mar 5 08:00:00 GMT-0800 2009 or vice-versa.