# DataGrid CellRenderer help? (date formating)

**URL:** https://forum.kirupa.com/t/datagrid-cellrenderer-help-date-formating/231372
**Category:** flash
**Created:** [July 4, 2007, 5:56am UTC](https://forum.kirupa.com/t/datagrid-cellrenderer-help-date-formating/231372 "2007-07-04T05:56:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![GeoffR](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@GeoffR](https://forum.kirupa.com/u/GeoffR)
#### Post date: [July 4, 2007, 5:56am UTC](https://forum.kirupa.com/t/datagrid-cellrenderer-help-date-formating/231372/1 "2007-07-04T05:56:06Z")

</div>

Hi, I’m returning some info from a Database via a PHP script into Flash using the XML Connector \> DataSet \> DataGrid components to display some audio file details. Overall I have it working nicely, but my problem is [COLOR=darkorange]I cannot figure out how to get my **dates** to display nicely and remain sortable[/COLOR] (by clicking on the Column Header).

I want to present the dates in the format, “ **Wed Jul 4 2007 3:33pm** ” if possible.

Since I have used drag’n’drop components, I don’t understand the actionscript that creates the datagrid (although I have been able to achieve some styling on the grid via actionscript –  
e.g.  
[COLOR=gray]sounds\_grd.setStyle(“alternatingRowColors”, [0xF7F7F7, 0xF2F2F2]);[/COLOR]

**Can anyone help me with the code required to format the (sortable) date column?**

Currently I am passing in the date value from the database as a Number, in the format: 200707041533 (as per the above date example).

By the way, I want my swf to be usable from Flash player 7 and up ( or less if possible), thus I am using Actionscript 2.

Help greatly appreciated! I have asked this elsewhere over the last few months, but so far have had no clear solution.

Geoff
