[ Web Proxy ]
URL:
Viewing: https://developers.google.com/maps/documentation/timezone/requests-timezone#required-parameters [Back]  [Original]

Time Zone requests and responses  |  Time Zone API  |  Google for Developers Skip to main content
Send feedback

Time Zone requests and responses Stay organized with collections Save and categorize content based on your preferences.

outlined_flag

Time Zone

Time Zone API requests are constructed as a URL string. The API returns time zone data for a point on the earth, specified by a latitude-longitude pair. Note that time zone data may not be available for locations over water, such as oceans or seas.

A Time Zone request takes the following form:

https://maps.googleapis.com/maps/api/timezone/outputFormat?parameters

where outputFormat may be either of the following values:

Note: URLs must be properly encoded to be valid and are limited to 16384 characters for all web services. Be aware of this limit when constructing your URLs. Note that different browsers, proxies, and servers may have different URL character limits as well.

Required parameters

Optional parameters

Time Zone examples

This section includes some sample queries that demonstrate features of the API.

The below query performs a time zone request for Nevada, USA. The timestamp is set to December 5, 2024.

URL

https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1733428634&key=YOUR_API_KEY

curl

curl -L -X GET 'https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1733428634&key=YOUR_API_KEY'

JSON

{
  "dstOffset": 0,
  "rawOffset": -28800,
  "status": "OK",
  "timeZoneId": "America/Los_Angeles",
  "timeZoneName": "Pacific Standard Time",
}

XML

<TimeZoneResponse>
 <status>OK</status>
 <raw_offset>-28800.0000000</raw_offset>
 <dst_offset>0.0000000</dst_offset>
 <time_zone_id>America/Los_Angeles</time_zone_id>
 <time_zone_name>Pacific Standard Time</time_zone_name>
</TimeZoneResponse>
      

The below query performs a time zone request for Nevada, USA. The location is the same as the above request, but the timestamp is set to March 15th, 2024. The response now includes a Daylight Savings Time offset.

URL

https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1710547034&key=YOUR_API_KEY

curl

curl -L -X GET 'https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1710547034&key=YOUR_API_KEY'

JSON

{
  "dstOffset": 3600,
  "rawOffset": -28800,
  "status": "OK",
  "timeZoneId": "America/Los_Angeles",
  "timeZoneName": "Pacific Daylight Time",
}
        

XML

<TimeZoneResponse>
 <status>OK</status>
 <raw_offset>-28800.0000000</raw_offset>
 <dst_offset>3600.0000000</dst_offset>
 <time_zone_id>America/Los_Angeles</time_zone_id>
 <time_zone_name>Pacific Daylight Time</time_zone_name>
</TimeZoneResponse>

This example is similar to the above two, but sets a language parameter. The response will now be localized to Spanish.

URL

https://maps.googleapis.com/maps/api/timezone/json?language=es&location=39.6034810,-119.6822510&timestamp=1710547034&key=YOUR_API_KEY

curl

curl -L -X GET 'https://maps.googleapis.com/maps/api/timezone/json?location=39.6034810,-119.6822510&timestamp=1710547034&language=es&key=YOUR_API_KEY'

JSON

{
  "dstOffset": 3600,
  "rawOffset": -28800,
  "status": "OK",
  "timeZoneId": "America/Los_Angeles",
  "timeZoneName": "hora de verano del Pacfico",
}
      

XML

<TimeZoneResponse>
 <status>OK</status>
 <raw_offset>-28800.0000000</raw_offset>
 <dst_offset>3600.0000000</dst_offset>
 <time_zone_id>America/Los_Angeles</time_zone_id>
 <time_zone_name>hora de verano del Pacfico</time_zone_name>
</TimeZoneResponse>
      

Time Zone responses

For each valid request, the Time Zone returns a response in the format indicated within the request URL.

TimeZoneResponse

Field Required Type Description
required TimeZoneStatus See TimeZoneStatus for more information.
optional number

The offset for daylight-savings time in seconds. This will be zero if the time zone is not in Daylight Savings Time during the specified timestamp.

optional string

Detailed information about the reasons behind the given status code. Included if status other than Ok.

optional number

The offset from UTC (in seconds) for the given location. This does not take into effect daylight savings.

optional string

a string containing the ID of the time zone, such as "America/Los_Angeles" or "Australia/Sydney". These IDs are defined by Unicode Common Locale Data Repository (CLDR) project, and currently available in file timezone.xml. When a timezone has several IDs, the canonical one is returned. In xml responses, this is the first alias of each timezone. For example, "Asia/Calcutta" is returned, not "Asia/Kolkata".

optional string

The long form name of the time zone. This field will be localized if the language parameter is set. eg. Pacific Daylight Time or Australian Eastern Daylight Time.

TimeZoneStatus

The status field within the Time Zone response object contains the status of the request. The status field may contain the following values:

Calculating the local time

The local time of a given location is the sum of the timestamp parameter, and the dstOffset and rawOffset fields from the result.

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-19 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-19 UTC."],[],["The Time Zone API returns data for a given latitude/longitude, using a URL string with parameters. Required parameters include `location` (latitude, longitude) and `timestamp` (seconds since January 1, 1970 UTC). An optional `language` parameter localizes the response. The API outputs in JSON or XML, with responses containing `status`, `dstOffset`, `rawOffset`, `timeZoneId`, and `timeZoneName`. Daylight Savings is factored in using the timestamp. It provides various status codes, and local time is calculated by adding the timestamp to the dstOffset and rawOffset.\n"]]

Web Proxy Viewer  |  New URL  |  Original Page