So I'm working with Data retrieved from a C# Rest Server. One of the values in the array is of type Date. When I try to perform calculations on it, like this:
let difference = date1.getTime() - date2.getTime();
I encounter the following error message:
date1.getTime is not a function
I suspect that the issue lies in the fact that Date
in Java is different from the Date type in TypeScript.
Is there a way to convert a value of type Date
(Java) to type Date
(TypeScript)?
Alternatively, could the error be caused by something else?