I have a JSON object which has a datetime field like below -

```
2019-02-10T07:17:42.236Z

```

I have retrieved this field onto my angular component using the code below -

```
this.filteredVenues.forEach(ven => console.log(ven.lastheartbeat));

```

When i tried to convert the datetime format above to milliseconds using the code below -

```
this.filteredVenues.forEach(ven => console.log(ven.lastheartbeat.getTime()))

```

I get the error below -

```
ERROR TypeError: Cannot read property 'getTime' of undefined

```

If i run trials on getTime() method, it works fine here -
<https://www.w3schools.com/code/tryit.asp?filename=G12D4LYOO7IG>

What am i doing wrong?