Declare a DateFormatter with an MM/DD/YYYY date format
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:DateFormatter id="dateFormatter" formatString="month: MM, day: DD, year: YYYY" />
<mx:Label text="Enter date (mm/dd/yyyy):" />
<mx:TextInput id="dob" text="" />
<mx:Label text="Formatted date: " />
<mx:TextInput id="formattedDate" text="" editable="false" />
<mx:Button label="Format Input" click="formattedDate.text=dateFormatter.format(dob.text);" />
</mx:Application>
Related examples in the same category