-1

I'm using Google maps TimeZone API to get the timezone and utc offset for a location (lat/lng) in New York, London, Paris, Sydney.

Ex. https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810%2C-119.6822510&timestamp=1331161200&key=YOUR_API_KEY'

QUESTION - Will a locally generated timestamp (ex. San Francisco) change the utc offset or time zone for a different location lat/lng (ex. New York, London, Sydney, etc)?

I'm trying to understand the timestamp documentation, but I'm not that smart.

timestamp:

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.

chuckd
  • 13,460
  • 29
  • 152
  • 331

1 Answers1

0

It does not matter where the timestamp is generated as long as it is "seconds since midnight, January 1, 1970 UTC".

For example, you can generate such timestamp in C# by -

DateTimeOffset.Now.ToUnixTimeSeconds()

This line of code will return you same number regardless of your machine's timezone, because it is the number of seconds elapsed since a particular time - 1/1/1970 UTC.

ch_g
  • 1,394
  • 8
  • 12