# A new Date and a mysql problem

**URL:** <https://forum.kirupa.com/t/a-new-date-and-a-mysql-problem/227172>\
**Category:** Uncategorized\
**Created:** [May 28, 2007, 3:56am UTC](https://forum.kirupa.com/t/a-new-date-and-a-mysql-problem/227172 "2007-05-28T03:56:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshchernoff](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshchernoff/32/1852_2.png) [@joshchernoff](https://forum.kirupa.com/u/joshchernoff)\
**Post date:** [May 28, 2007, 3:56am UTC](https://forum.kirupa.com/t/a-new-date-and-a-mysql-problem/227172/1 "2007-05-28T03:56:17Z")

</div>

ok I have amfphp returning a query that is a Date data type in side of mysql.  
It is in this format “2007-27-5” which is a string. When making a date object in flash you need some thing like this

```auto
var testDate:Date = new Date(2007, 4, 27);

```

I would like to know if there is a short cut around this problem.  
As it would look now I need to take that string and have a regular expression pull the sub-strings (“2007”, “5”, “27”) out and some how convert the sub-strings in to a numbers (2007, 5, 27), then set vars with the number latter sending it to that date constructor.

any ideas?
