# Display Mysql date in flash

**URL:** <https://forum.kirupa.com/t/display-mysql-date-in-flash/142771>\
**Category:** Uncategorized\
**Created:** [March 31, 2005, 10:51am UTC](https://forum.kirupa.com/t/display-mysql-date-in-flash/142771 "2005-03-31T10:51:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkrakatau](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@kkrakatau](https://forum.kirupa.com/u/kkrakatau)\
**Post date:** [March 31, 2005, 10:51am UTC](https://forum.kirupa.com/t/display-mysql-date-in-flash/142771/1 "2005-03-31T10:51:19Z")

</div>

Can anyone tell me the optimum way to do the following:

I have a php page that sends xml compiled from data in a mysql table to my swf. The swf is actually an auction and I need to load in the’ end time’ of that item and do a date comparision for a countdown.

So what I’m asking for, in a nutshell, is for the best way to load in a date from a database in such a way that it can be used for date comparisons?

The mysql field is a datetime field. I can modify the format in php to whatever you feel in the best format (I need year, month,day,hour,min, seconds) - but I don’t know what to do with the date once I have it in flash.

example xml: \<Item end\_time=“2005-04-01 00:00:00” /\>

can I convert it into a valid date with out string manipulation? since the following doesn’t work (obviously)

my\_date = new Date(oXML.firstChild.attributes.end\_time)

What I need is to be able to take the current time & substract it from the time in the xml to give me the remaining time.

I hope this makes sense !!!
