3 Replies Latest reply on Feb 25, 2008 8:00 PM by peterent

    Date Picker

    jefflemon Level 1
      I have a date picker and I send the value by:

      this.tagDate.selectedDate

      But it pumps out aload of numbers, how can I convert this to a proper date?
        • 1. Re: Date Picker
          peterent Level 2
          The selectedDate property of the DateChooser and DateField is a Date. You should be getting an object of type Date and not a bunch of numbers.
          • 2. Re: Date Picker
            jefflemon Level 1
            Im getting:
            1.2040704E+12

            whats wrong?
            • 3. Re: Date Picker
              peterent Level 2
              So something like:

              <mx:DateChooser id="tagDate">
              <mx:change><![CDATA[
              trace(event.target.selectedDate);
              ]]></mx:change>
              </mx:DateChooser>

              is displaying 1.2040704E+12 and not "Monday Feb 25 2008" or something like that?

              The number you see looks to be the actual time in milliseconds. If that's the case, then taking that value and turning into a Date is:

              var d:Date = new Date( 1.2040704E+12 );

              Substituting the value for your expression, of course.
              ...