just add this as that column's cell renderer <mx:DataGridColumn cellrenderer="dateFormat"/>
and save the cell renderer as dateFormat.mxml One reason I use this as a cell renderer is because I can use this in multiple places with have the function in multiple places... -----Original Message----- From: Miguel Diaz Valenzuela [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 12:55 PM To: [email protected] Subject: [flexcoders] Re: datetime format ok, but what happen if datetime I want to format is on a datagrid? --- In [email protected], "Clint Tredway" <[EMAIL PROTECTED]> wrote: > Here is a cell renderer that I use: > <?xml version="1.0" encoding="iso-8859-1"?> > <mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml"> > <mx:Script> > <![CDATA[ > > function setValue(str:String, item:Object, sel:Boolean):Void { > date_txt.text = StandardDateFormat.format(item.date); > } > > ]]> > </mx:Script> > <!-- Declare a formatter and specify formatting properties. --> > <mx:DateFormatter id="StandardDateFormat" formatString="M/DD/YYYY"/> > > <!-- Trigger the formatter while populating a string with data. --> > <mx:Text id="date_txt"/> > > </mx:Canvas> > > Just change the formatString to how you want to format your date.... > > -----Original Message----- > From: Miguel Diaz Valenzuela [mailto:[EMAIL PROTECTED] > Sent: Monday, February 28, 2005 12:39 PM > To: [email protected] > Subject: [flexcoders] datetime format > > > > > well, i�m again with another question to you coders > > i have a datetime row, with following format: 25/02/2005 12:57:00 > > how can I format this one and change it in Macromedia Flex to this: > 25/02/2005 > > thanks in advance for all reply > > > > > > > Yahoo! Groups Links Yahoo! Groups Links

