Time zone is a simple service. Input a location and time (historical, current, or future), and it will return the time zone information for that location, including the time zone ID, UTC standard time/local time, offset from UTC standard time, and daylight saving time (DST) offset.
Application
[Example 1] The user is in Tokyo, and their colleague is in New York. They plan to schedule a meeting the next day. They need to know the local times on both sides to coordinate the timing for both parties.
[Example 2] The customer is developing a website or application that needs to display the current time in different cities in real time
Guidelines
Apply for a
【Web Service API】Key
Enable overseas permissions for the applied Key by submitting a ticket to request overseas permissions
Construct the HTTP request URL, including the Key obtained in Step 1 as a required parameter
Receive and parse the data returned from the HTTP request (in JSON or XML format)
Unless otherwise specified, all input parameters and output data are encoded in
UTF-8。
Time Zone
Time Zone API Service URL
URL | https://sg-restapi.opnavi.com/v5/timezone |
Request Method | GET |
The parameters represent both required and optional parameters. All parameters are separated by the
ampersand character (&). The list below enumerates these parameters and their usage rules.
Request Parameters
Parameter Name | Description | Specification | Mandatory | Default |
key | Service Authorization Token | Applying for a Web Service API Key and Submitting a Work Order for Overseas Permissions on Amap Map Official Website | Mandatory | None |
location | Location | Longitude and latitude are separated by ",", with longitude first and latitude second. The decimal places of the coordinates must not exceed 6 digits. Only one location is allowed. | Mandatory | None |
time_type | Time Type | 1-UTC standard time 2-Local time supports dates after January 1, 1970 | No | 1 |
time | Time | When time_type is set to 1, it returns a timestamp in seconds. When time_type is set to 2, it returns a date and time in the format YYYY-MM-DDThh:mm:ss, for example: 2025-09-01T10:00:00, which can be a past or future time. | Mandatory | None |
Examples
https://sg-restapi.opnavi.com/v5/timezone?location=-57.31786,-24.89475&time_type=2&time=2025-09-01T10:00:00&key=<The key you applied for>
https://sg-restapi.opnavi.com/v5/timezone?location=139.755957,35.684122&time_type=1&time=1756731600&key=<The key you applied for>
Response Parameters Description
Name | Description | Specification |
status | Return result status value | 0: Request failed; 1: Request succeeded |
info | Return status description | When status is 0, info returns the reason for the error; otherwise, it returns 'OK'. For details, refer to the info status table. |
infocode | Return Status Code | For details, refer to the infocode in the info status table: info status table |
time_zone_id | Time zone ID, for example: America/Asuncion | / |
time | Time | When the input is 'local time', it represents UTC standard time. When the input is 'UTC standard time', it represents 'local time'. |
rawoffset | Offset from Coordinated Universal Time (UTC) | Unit: seconds |
dstoffset | Daylight saving time offset | Unit: seconds |