Time Zone API の概要
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Time Zone API は、Google Cloud Storage の
緯度と経度の座標、選択した日時。時刻を返します。
UTC と夏時間のオフセットを含む、ロケーションのゾーンデータ
あります。
Time Zone API を使用する理由
Time Zone API を使用すると、地図上の特定の場所の日時に関するタイムゾーン ID と名前を提供するアプリケーションを開発できます。たとえば、
タイムゾーン データ:
- Google Maps Platform の地図上の場所のローカライズされたタイムゾーン名。
- UTC からのタイムゾーン オフセットと夏時間。
タイムゾーンデータは、
ウェブサイトやアプリに、ユーザーに関連する時間ベースのデータが表示されます。
Time Zone API でできること
Time Zone API を使用すると、地球上の位置のタイムゾーンと、各位置の UTC からのタイム オフセットと夏時間のタイム オフセットをリクエストできます。
Time Zone API の仕組み
Time Zone API は、緯度と経度の HTTPS リクエストを受け入れます。
必要な日時をタイムスタンプとして指定し、必要に応じて
指定します。リクエストで指定された形式でデータを返します。次の例は、HTTP リクエストに対する
米国ネバダ州でリクエストされた出力が JSON で示されています。
https://maps.googleapis.com/maps/api/timezone/json
?location=39.6034810%2C-119.6822510
×tamp=1733428634
&key=YOUR_API_KEY
リソース
次の表は、
Time Zone API とそのデータを返します。
データリソース |
返されるデータ |
戻り値の形式 |
タイムゾーン
リクエストには、場所とタイムスタンプを含めて指定します。必須パラメータをご覧ください。
|
- タイムゾーン ID。
- タイムゾーン名(ローカライズ可)
- UTC からのオフセット(秒単位)
- DST のオフセット(秒)
- 具体的なレスポンスの例については、タイムゾーンをご覧ください。
|
|
Time Zone API の使用方法
1 |
セットアップする |
まず、Google Cloud プロジェクトを設定するから始め、その後の設定手順を完了します。 |
2 |
タイムゾーン リクエストをお試しください |
API キーを取得したら、ブラウザから直接 Time Zone API のテストを始めることができます。タイムゾーンの例をご覧ください。
(タイムゾーンのリクエストとレスポンスのガイド)をご覧ください。
|
3 |
レスポンスの基本を理解する |
アプリやウェブサイトでタイムゾーン データを利用する方法をご確認ください。
タイムゾーンのレスポンスを参照
をご覧ください。
|
5 |
タイムゾーン データを独自のアプリに組み込む |
タイムゾーン データを使用すると、さまざまな地域のユーザー向けにアプリやウェブサイトを強化できます。
言語 / 地域ごとに設定できます。
|
利用可能なクライアント ライブラリ
この API を
次のいずれかのクライアント ライブラリを使用できます。
Google マップ用の Java クライアント、Python クライアント、Go クライアント、Node.js クライアント
サービスはコミュニティがサポートするクライアント ライブラリで、
Apache 2.0 ライセンス。
GitHub からダウンロードしてください。GitHub には、インストール手順やサンプルコードも用意されています。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-29 UTC。
[null,null,["最終更新日 2025-08-29 UTC。"],[[["\u003cp\u003eThe Time Zone API provides time zone data, including UTC and daylight savings offsets, for specific locations based on latitude/longitude and timestamp.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the API to display localized time zone names, offsets, and enhance time-based data in your applications.\u003c/p\u003e\n"],["\u003cp\u003eThe API accepts HTTPS requests with location and timestamp parameters and returns data in JSON or XML format.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries are available in Java, Python, Go, and Node.js for easy integration into your projects.\u003c/p\u003e\n"]]],["The Time Zone API retrieves time zone data for specific locations using latitude/longitude coordinates and a timestamp. It returns the time zone ID, localized name, UTC offset, and daylight saving time offset in JSON or XML format. To use it, you send an HTTPS request with location and timestamp and you can then utilize the data in your website or apps to show time-based information relevant to users' locations. You can also use one of the provided client libraries to access the API.\n"],null,["# Time Zone API overview\n\nThe Time Zone API is a service that accepts an HTTP request of\nlatitude/longitude coordinates and a chosen date and time. It returns the time\nzone data for the location, including offsets for UTC and daylight savings\ntime.\n\nWhy use the Time Zone API\n-------------------------\n\nWith the Time Zone API, you can develop applications that provide\nthe time zone ID and name for dates and times at specific locations\non a map. For example, you can show the following\ntime zone data:\n\n- Localized time zone names for map locations from the Google Maps Platform.\n- Time zone offsets from UTC and for daylight savings.\n\nTime zone data can be particularly useful when you want to have your\nwebsite or app display time-based data relevant to your users.\n\nWhat you can do with the Time Zone API\n--------------------------------------\n\nWith the Time Zone API, you can request the time zone for\nlocations on the surface of the earth, with the time offset from\nUTC and for daylight savings time for each of\nthose locations.\n\nHow the Time Zone API works\n---------------------------\n\nThe Time Zone API accepts an HTTPS request of latitude/longitude\ncoordinates, the desired date and time as a timestamp, and optionally,\na language code. It returns data in the format specified by the request.\nThe following example shows a request for\nNevada, USA, with a requested output in JSON. \n\n```scdoc\n https://maps.googleapis.com/maps/api/timezone/json\n ?location=39.6034810%2C-119.6822510\n ×tamp=1733428634\n &key=YOUR_API_KEY\n \n```\n\n### Resources\n\nThe following table summarizes the resources available through the\nTime Zone API along with the data it returns.\n\n| Data resources | Data returned | Return format |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|\n| **Timezone** You provide your request along with location and timestamp. See [required parameters](/maps/documentation/timezone/requests-timezone#required-parameters). | - Time zone ID. - Time zone name, optionally localized - Offset from UTC, in seconds - Offset for DST, in seconds - See Time Zone for specific response examples. | - JSON - XML |\n\nHow to use the Time Zone API\n----------------------------\n\n|---|--------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1 | **Get set up** | Start with [Set up your Google Cloud project](/maps/documentation/elevation/cloud-setup) and complete the setup instructions that follow. |\n| 2 | **Try a timezone request** | Once you have an API key, you can start testing out the Time Zone API directly from your browser. See [Time Zone examples](/maps/documentation/timezone/requests-timezone#examples) in the Timezone requests and responses guide for details. |\n| 3 | **Understand response basics** | Explore how to use timezone data in your app or website. See [Time Zone responses](/maps/documentation/timezone/requests-timezone#responses) for details. |\n| 5 | **Incorporate timezone data into your own app!** | You can use timezone data to enhance apps and websites for users across different time-based locales. |\n\n### Available client libraries\n\nCall this API in the language of\nyour choice through one of the following client libraries:\n\n- [Java\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-java)\n- [Python\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-python)\n- [Go Client\n for Google Maps Services](https://github.com/googlemaps/google-maps-services-go)\n- [Node.js\n Client for Google Maps Services](https://github.com/googlemaps/google-maps-services-js)\n\nThe Java Client, Python Client, Go Client and Node.js Client for Google Maps\nServices are community-supported client libraries, open sourced under the\n[Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0).\nDownload them from GitHub, where you can also find installation instructions and sample code.\n\nWhat's next\n-----------\n\n- **Learn how to make Time Zone requests** : Go to [Time Zone Requests and responses](/maps/documentation/timezone/requests-timezone).\n- **Follow best practices** : Go to [Web Services Best Practices](/maps/documentation/timezone/web-service-best-practices)."]]