Formatting DatePicker Date

Hi Yisrael,

Thanks for the info,

I converted the date from Sun Jun 03 2018 00:00:00 GMT-0500 (CDT) to 6-4-2018 (M-D-YYYY),
I dug around the references you provided but didn’t find a way to transfrom it into YYYY-MM-DD.

I know this is a small detail, but I need it in this specific format in order to make an API call.

Do you have any suggestions in regards to transforming it into this format?

I share with you my code:


var myDate = new Date($w("#datePicker5").value);
var myEndDate = new Date($w("#datePicker6").value);
var updated_Until = ((myDate.getMonth() + 1) + "-" + myDate.getDate() + "-" + myDate.getFullYear());
var updated_Since = ((myEndDate.getMonth() + 1) + "-" + myEndDate.getDate() + "-" + myEndDate.getFullYear());

Thanks!

I really appreciate your help!