# Converting a variable to another format

**URL:** <https://forum.kirupa.com/t/converting-a-variable-to-another-format/175443>\
**Category:** Uncategorized\
**Created:** [January 14, 2006, 2:17pm UTC](https://forum.kirupa.com/t/converting-a-variable-to-another-format/175443 "2006-01-14T14:17:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![booler](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@booler](https://forum.kirupa.com/u/booler)\
**Post date:** [January 14, 2006, 2:17pm UTC](https://forum.kirupa.com/t/converting-a-variable-to-another-format/175443/1 "2006-01-14T14:17:38Z")

</div>

//sample datetime var output: 2006-06-31 12:00:00  
this is the output I get from the variable I’m importing via FlashVars  
they variable input format is: 2006-06-31 12:00:00  
thats exactly what it looks like coming from the php sctipt

I need to break it up into the year, month, day, hour, mins and sec

any ideas on how I can split it up to use here with these variables  
eventDate = new Date(yearDue, monthDue, dayDue, hourDue, minDue, “00”);
