Q:

How to convert Angular Date to new Date() in specific format?

I am new to Angular. I am using Angular 8 with ASP.net Core.
I installed ng-Bootstrap so I could get a nice DatePicker. For some reason, the DatePicker uses its own format that stores the Date like so.
StartDate: {year: 2019, month: 8, day: 31}
I need to create a new Date object and store the date like so.
StartDate: "2019-31-08"
This does not work.
var newDate = new Date(StartDate.getFullYearUtc(), StartDate.getMonthUtc(), Start.getDayUtc);

This does not work. It creates a weird looking date.
var newDate = new Date("2019-31-08");

This does not work. It wants to create a string.
var date = this.datePipe.transform(StartDate, "yyyy-MM-dd");

This converts to string.
var newDate = new Date("2019-31-08").toISOString();

Does anyone know how to create a new Date object without converting to string?
Any help is much appreciated! Thanks!

A:

Wow, what a mess! I first had to use moment to even read the Date. I was then able to convert the ISO String to a Date my ASP.Net Core Web API could work with.  
Converts to ISO String
var startDate = moment(content.StartDate).add(-1,'M').toISOString();

ISO String converted to Date
const newStartDate = moment(startDate, moment.defaultFormatUtc).toDate();

The Date is still not formatted like it was using the normal Angular Date object from a form, but at least ASP.Net can work with it.
Asp.Net Core Web API
Convert.ToDateTime(content.StartDate);

The Converts to ISO String method won't work with all the NgbDates. I modified this converter to work with Date. This seems to do the trick.
https://stackoverflow.com/a/54078224

