I have a PHP script that outputs an array of data. This is then transformed into JSON using the json_encode() function.
JSON
json_encode()
My issue
An improvement or simplification of @jeremyharris answer would be this one:
DateTime objects in PHP have the getTimestamp() format, use it and multiply the value by 1000:
getTimestamp()
getTimestamp() * 1000; ?> // JavaScript let startTime = new Date(phpDateTimeStamp);