1 Reply Latest reply on Nov 17, 2009 4:36 AM by David_F57

    Flex and Dates

    MartyO Level 1

      Having all sorts of issues with dates in Flex

       

      The generated code from the data services (php) picks up the timestamp filed as an "int" - and as a result all sorts of conversions are going on in the declarations. eg

       

      date_created="{parseInt(date_createdTextInput.text)}

       

      Is there a simple way to get a date in and out of flex - should I change it to a String?

       

      This thread seems to suggest it is the easiest way to go - http://forums.adobe.com/thread/508729

       

      DateField.dateToString(date,format)

      DateField.stringToDate(string,format)

       

      thanks

      martin

        • 1. Re: Flex and Dates
          David_F57 Level 5

          Hi,

           

          The thread you mentioned pretty much covers the date issue when you are returned or sending date strings, timestamps are a little different as int values are epoch times which are basically the milliseconds since 1st January 1970, if you want to deal with timestamps you would need to read the int in and convert to string then convert the date string back to int to store in the database. Not sure how the datawizards handle epochs but its obviously more convoluted than date strings.

           

          David.