24
Easiest way, assuming you're not bothered about the function being dynamic:
function reformatDate(dateStr)
{
var dArr = dateStr.split("-"); // ex input: "2010-01-18"
return dArr[2]+ "/" +dArr[1]+ "/" +dArr[0].substring(2); //ex output: "18/01/10"
}
You may also want to look into using date.js:
To futureproof your application, you may want to return time in a UTC timestamp and format with JavaScript. This'll allow you to support different formats for different countries (in the U.S., we are most familiar with DD-MM-YYYY, or instance) as well as timezones.