Getting ISO date from a DateTime field?

Getting ISO date from a DateTime field?

I'm trying to get a date in ISO format by extracting the data from a DateTime field in the following manner:
  1. var startDateValue = $CS.getValue("GUDF_DATE2");
  2. var startDate = startDateValue.getYear() + "-" + startDateValue.getMonth() + "-" + startDateValue.getDate();
Instead of producing a date in a format similar to 2019-06-19, the output I'm getting is along the lines of 119-6-1 .

What is the correct syntax to achieve this?

Thank you.

                  New to ADSelfService Plus?