# Format Date from XML

**URL:** <https://forum.kirupa.com/t/format-date-from-xml/278121>\
**Category:** flash\
**Created:** [December 22, 2008, 7:12pm UTC](https://forum.kirupa.com/t/format-date-from-xml/278121 "2008-12-22T19:12:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thundercat](https://avatars.discourse-cdn.com/v4/letter/t/dbc845/32.png) [@Thundercat](https://forum.kirupa.com/u/Thundercat)\
**Post date:** [December 22, 2008, 7:12pm UTC](https://forum.kirupa.com/t/format-date-from-xml/278121/1 "2008-12-22T19:12:09Z")

</div>

I’m trying to read and format a date from XML

The XML date is :

```auto
<pubDate>Thu, 28 Aug 2008 09:19:45 -0500</pubDate>

```

I have the following code:

```auto
		var newsDate:Date = new Date ();
		newsDate = xml.item[0].pubDate as Date;
		trace(newsDate);

```

Which returns null.

I need to get this input into a form that Date can recogize so that the date can be formatted as MM/DD/YY.

This is in Flash, not Flex, so mx.formatters.DateFormatter is not an option.

Any suggestions?
