API for time zones

TimeZone API is a set of functions designed for working with time zones. It allows you to obtain information about time zones based on geographic coordinates or IANA codes (e.g., Europe/Prague). These functions are essential for developers who work with local time or UTC time worldwide.

  • Search by coordinates: Get the time zone and time information by entering the latitude and longitude.
  • Search by IANA code: Retrieve detailed information about a time zone using its IANA name.
  • Time conversion: Convert times between different time zones or between local time and UTC.
  • Current time: Find out the current time in any time zone.
  • Scheduling and time differences: Calculate time differences for planning events across time zones.

Usage examples:
– Find the current time in New York
– Convert the opening hours of a branch in Tokyo to local time in the Czech Republic
– Display the local start time and time offset for GPX route records around the world.

See a specific usage example in this tutorial.

Function Descriptions

  • list-timezones – Returns a list of IANA names of all time zones
  • timezone – Returns detailed information about a time zone – the input parameter is the IANA name
  • coordinate – Returns detailed information about the time zone at the given coordinates – the input is the coordinates

Technical Documentation

https://api.mapy.cz/v1/docs/timezone/

The technical documentation includes a detailed description of input and output parameters, default values, errors, and other specifics.

Return Values for timezone and coordinate

Both of these functions return detailed information about the time zone

timezoneNameIANA name of the time zone (e.g., Europe/Prague)
currentTimeAbbreviationCurrent abbreviation of the time zone (e.g., CEST)
standardTimeAbbreviationStandard time abbreviation (e.g., CET)
currentLocalTimeCurrent local time in ISO 8601 format (e.g., 2024-10-16T15:03:51.248)
currentUtcTimeCurrent UTC time in ISO 8601 format (e.g., 2024-10-16T13:03:51.248Z)
currentUtcOffsetSecondsCurrent UTC offset in seconds (e.g., 7200)
standardUtcOffsetSecondsStandard UTC offset in seconds (e.g., 3600)
hasDstIndicator if the time zone observes daylight saving time (true/false)
isDstActiveIndicator if daylight saving time is currently active (true/false)
dstInfo.dstAbbreviationDaylight saving time abbreviation (e.g., CEST)
dstInfo.dstStartUtcTimeUTC time when daylight saving time starts in ISO 8601 format (e.g., 2024-03-31T01:00:00.000Z)
dstInfo.dstStartLocalTimeLocal time when daylight saving time starts in ISO 8601 format (e.g., 2024-03-31T03:00:00.000)
dstInfo.dstEndUtcTimeUTC time when daylight saving time ends in ISO 8601 format (e.g., 2024-10-27T01:00:00.000Z)
dstInfo.dstEndLocalTimeLocal time when daylight saving time ends in ISO 8601 format (e.g., 2024-10-27T02:00:00.000)
dstInfo.dstOffsetSecondsDaylight saving time offset from standard time in seconds (e.g., 3600)
dstInfo.dstDurationSecondsDuration of daylight saving time in seconds (e.g., 18144000)