0

I have this conversion function:

public dateFormat(date: string): Date {
  const splitDate = date.split('/');
  const newDate = new Date(parseInt(splitDate[2], 10), parseInt(splitDate[1], 10) - 1, 
  parseInt(splitDate[0], 10));
  return newDate;

And this function is receiving dates like this:

"24/09/2022 07:30:14"

but the return is this:

2022-09-24T00:00:00.000Z

I need the time converted to, how do I do that?

Fernanda
  • 59
  • 6

0 Answers0