2 Replies Latest reply on Dec 30, 2007 3:08 PM by Mission2k

    Dateformatter not working as expected

    Mission2k
      I must be missing something simple. I am simply trying to take the current date and format it to look like MM/DD/YYYY. I am using a dateformatter but it shows 12/29/500 for the year when using MM/DD/YYYY. I have verified my date is correct on my PC. Any ideas.

      Below is my dateformatter and the code I am using.

      <mx:DateFormatter id="dateFormatter" formatString="MM/DD/YYYY"/>

      public function addStatement():void {
      var currentDate:String=new Date().toString();
      statements.addItem({Statement:txtAdd.text, Date:dateFormatter.format(currentDate)});
      }
      }