In several different moments, I need to convert dates from dd/mm/yyyy to mm/dd/yyyy.
I get the data formated like dd/mm/yyyy from a database.
So, I'd like to know how to use the same formula from different functions. For example in a function I do this:
function getMDY (){
var month = theDay.substr(3,2);
var day = theDay.substr(0,2);
var year = theDay.substr(6,4);
var theDate = month + "/" + day + "/" + year;
trace (theDate);
}
I want to call this function from other functions giving theDay value, and receiving back the value of theDate.
I don't know how to do this. Any clue?
Thanks.