Once you fix the quote issue, there is another issue here:
$current_timestamp = date("Y-m-d H:i:s")
That will produce a timestamp in the format (using moment.js tokens) YYYY-MM-DD HH:mm:ss (e.g. 2020-03-08 16:38:21), which is not supported by ECMA-262. You don't show how the timestamp is converted to a Date, but I'll guess you're using the built–in parser like:
var d = new Date(current_time);
However, since parsing of unsupported formats is implementation dependent, some browsers will return an invalid date.
Also, the PHP code produces a "local" date for the server, presumably it's set to UTC. Where browsers do parse a date in the format YYYY-MM-DD HH:mm:ss, it will almost certainly be as local to the browser's host system so will represent a different moment in time from the initial timestamp if the two systems have different settings.
The OP doesn't say what format $user_last_activity is. Presumably it's another timestamp, so it will have the same issues with parsing.
Once the above issues are sorted, you can get the difference in milliseconds between two dates by simply subtracting one from the other, see Difference between dates in JavaScript. The time difference can then be converted to days, hours, minutes, whatever.