so I have this array.

```
["2020-01-31 18:31:01", "2020-02-03 14:04:30", "2020-02-04 05:58:48", "2020-02-04 14:11:16"]

```

and I like to convert it to object.

```
0: {date: "2020-01-31", time: ["8:31:01"]}
1: {date: "2020-02-03", time: ["4:04:30"]}
2: {date: "2020-02-04", time: ["5:58:48", "14:11:16"]}

```

But I 'm getting this result

```
0: {date: "2020-01-31", time: "8:31:01"}
1: {date: "2020-02-03", time: "4:04:30"}
2: {date: "2020-02-04", time: "5:58:48"}

```

This is my code

```
var times = response.data.time;
var dates = [];
var t = [];
var d = '';
var newData = [];
times.forEach(time => {

   var da = time.substring(0, 10);
   var ti = time.substring(12, 19);

   if(d == da) {

     t.push(ti);

   } else {

     d = da

     var dt = {date: da, time: ti};
     newData.push(dt);

   }

 });

```

I'm having a hard time to figure this out hope you can help me.

Thanks.