Mysq returned date has time appended to it?

I have a custom query that returns three dates. The two dates giving me a problem are just date format, not datetime.

In the Custom query builder, i check the query results. Also correct.

But when the API returns the data it’s appending a time to it and I cannot find a way to get rid of it. Also, why would wappler append this to just a date?

So when I apply regStart.formatDate(‘mm-dd-yyyy’) to “2023-03-08T05:00:00.000Z” its coming out 00-08-2023, which obviously isn’t correct.

image

I was able to fix this by first doing a conversion to a date and then using dateformat.

I don’t entirely understand why that’s necessary but it fixed it.