Q:

Google Time Zone API incorrect number of hours?

I'm trying to compare the hours in between a website visitors location and a set location, by grabbing their current time, and then inserting that in to the Google Time Zone API with the location. However, no matter how I twist and turn it, it's either 1 or 2 hours incorrect, it seems. 
Am I reading something wrong?
The request: 
https://maps.googleapis.com/maps/api/timezone/json?location=40.7127753,-74.0059728&timestamp=1569956387&key=API_KEY

The Output: 
{
   "dstOffset" : 3600,
   "rawOffset" : -18000,
   "status" : "OK",
   "timeZoneId" : "America/New_York",
   "timeZoneName" : "Eastern Daylight Time"
}

The first part of the request is the longitude and latitude of New York City (retrieved from Google Places API), and the second value (timestamp) is seconds since 1 January 1970. This I get from the visitor with the following JavaScript:
+ new Date()
if (!Date.now) {
    Date.now = function() { return new Date().getTime(); }
}
Math.floor(Date.now() / 1000)

..which for me results in: 1569956387 (seconds)
Date.now() returns milliseconds since 1 January 1970, so I need to convert to seconds by dividing by 1000 as Google Time Zone API uses seconds since 1 January 1970. 
And according to Google Time Zone API docs:
rawOffset: the offset from UTC (in seconds) for the given location. This does not take into effect daylight savings.
..rawOffset is the JSON output
timestamp specifies the desired time as seconds since midnight, January 1, 1970 UTC. The Time Zone API uses the timestamp to determine whether or not Daylight Savings should be applied, based on the time zone of the location. Note that the API does not take historical time zones into account. That is, if you specify a past timestamp, the API does not take into account the possibility that the location was previously in a different time zone.
..timestamp is the seconds since 1 January 1970 specified in the request link
My local time is currently 9:59 PM (1569956387). Calculating either (18000/60)/60 or (21600/60)/60 tells me New York City should be 5 or 6 hours away, respectively, while the truth is that it's 7 hours away.

A:

A few things:

You don't need to make a function for Date.now unless you have to still support IE8, which is rare these days.  IE9+ and all major browsers have that function built in.
Date.now() and new Date().getTime() return timestamps based on UTC, not your local time.  It doesn't matter which time zone you run it from, it only matters that your computer's clock is synchronized.
The Google Time Zone API also takes its timestamp in terms of UTC, so you are doing the correct thing to pass it along (adjusting milliseconds to seconds).
Google is correctly telling you that for the given timestamp:

The lat/lon coordinates given are in the time zone identified with the America/New_York IANA time zone ID
The English long-form name to display is Eastern Daylight Time
The rawOffset is -18000 seconds, or UTC-5.  This field does not include DST, so it is the offset that would be used if Eastern Standard Time were in effect (which it is not for the timestamp given)
There is a dstOffset in effect of 3600 seconds (or 1 hour), which when added to the raw offset gives you (-18000 + 3600 == -14400), or UTC-4

Google is only telling you the offsets from UTC, not from your local time zone.  If you wanted to include that, you could call new Date().getTimezoneOffset() (based on the current time) and add that to the result.

