I have a web API endpoint that accepts a java.time.Instant
instance, like so:
{ "time": "2015-07-23T10:31:33Z" }
When I get a response back, I get this:
{ "time": 1437647493 }
When I try to create a new Date
instance in JavaScript like this:
new Date(1437647493);
I get this result:
Sat Jan 17 1970 15:20:47 GMT+0000 (GMT Standard Time)
What is the relationship between "2015-07-23T10:31:33Z"
and 1437647493
and how do I parse the result to JavaScript's Date
?