Formatting DatePicker Date

Hello Everyone!

I apologize for the delay in my response,

I found the solution using a combination of what you guys posted here and what I found at Stack Overflow and other web resources.

function formatDate(date) {
    var d = new Date(date),
        month = '' + (d.getMonth() + 1),
        day = '' + d.getDate(),
        year = d.getFullYear();

    if (month.length < 2) month = '0' + month;
    if (day.length < 2) day = '0' + day;

    return [year, month, day].join('-');
}

var updated_until = formatDate($w("#datePicker6").value);
var updated_since = formatDate($w("#datePicker5").value);

Thanks for your help!