Timezone - Get Timezone By ID

Time Zone by Id

Applies to: S0 and S1 pricing tiers.

This API returns current, historical, and future time zone information for the specified IANA time zone ID.

GET https://atlas.microsoft.com/timezone/byId/json?api-version=1.0&query={query}
GET https://atlas.microsoft.com/timezone/byId/json?subscription-key={subscription-key}&api-version=1.0&options={options}&timeStamp={timeStamp}&transitionsFrom={transitionsFrom}&transitionsYears={transitionsYears}&query={query}

URI Parameters

Name In Required Type Description
format
path True

Desired format of the response. Only json format is supported.

subscription-key
query
  • string

One of the Azure Maps keys provided from an Azure Map Account. Refer to the subscription-key security definition.

api-version
query True
  • string

Version number of Azure Maps API. Current version is 1.0

options
query

Alternatively, use alias "o". Options available for types of information returned in the result.

timeStamp
query
  • string
date-time

Alternatively, use alias "stamp", or "s". Reference time, if omitted, the API will use the machine time serving the request.

transitionsFrom
query
  • string
date-time

Alternatively, use alias "tf". The start date from which daylight savings time (DST) transitions are requested, only applies when "options" = all or "options" = transitions.

transitionsYears
query
  • integer

Alternatively, use alias "ty". The number of years from "transitionsFrom" for which DST transitions are requested, only applies when "options" = all or "options" = transitions.

query
query True
  • string

The IANA time zone ID.

Request Header

Name Required Type Description
x-ms-client-id
  • string

Specifies which account is intended for usage in conjunction with the Azure AD security model. It represents a unique ID for the Azure Maps account and can be retrieved from Azure Maps management plane Account API. To use Azure AD security in Azure Maps see the following articles for guidance.

Accept-Language
  • string

Specifies the language code in which the timezone names should be returned. If no language code is provided, the response will be in "EN". Please refer to Supported Languages for details.

Responses

Name Type Description
200 OK

OK

400 Bad Request

Bad request: one or more parameters were incorrectly specified or are mutually exclusive.

401 Unauthorized

Access denied due to invalid subscription key or invalid Azure Active Directory bearer token. Make sure to provide a valid key for an active Azure subscription and Maps resource. Otherwise, verify the WWW-Authenticate header for error code and description of the provided AAD bearer token.

Headers

  • WWW-Authenticate: string
403 Forbidden

Permission, capacity, or authentication issues.

404 Not Found

Not Found: the requested resource could not be found, but it may be available again in the future.

500 Internal Server Error

An error occurred while processing the request. Please try again later.

Security

azure_auth

These are the Azure Active Directory OAuth2 Flows. When paired with Azure Role Based Access control it can be used to control access to Azure Maps REST APIs. Azure Role based access controls are used to designate access to one or more Azure Maps resource account or sub-resources. Any user, group, or service principal can be granted access via a built in role or a custom role composed of one or more permissions to Azure Maps REST APIs.

To implement scenarios we recommend viewing authentication concepts. In summary, this security definition provides a solution for modeling application(s) via objects capable of access control on specific APIs and scopes.

Note

  • This security definition requires the use of the x-ms-client-id header to indicate which Azure Maps resource the application is requesting access to. This can be acquired from the Maps management API.
  • The Authorization URL is specific to the Azure public cloud instance. Sovereign clouds have unique Authorization URLs and Azure Active directory configurations.
  • The Azure role based access control is configured from the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs.
  • Usage of the Azure Maps Web SDK allows for configuration based setup of an application for multiple use cases.
  • Currently Azure Active Directory v1.0 tokens are supported.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

subscription-key

This is a shared key which is provisioned when creating an Azure Maps resource through the Azure management plane via Azure portal, Powershell, CLI, Azure SDKs, or REST APIs. With this key, any application is authorized to access all REST APIs. In other words, these can currently be treated as master keys to the account which they are issued for. For publicly exposed applications our recommendation is to use server to server access of Azure Maps REST APIs where this key can be securely stored.

Type: apiKey
In: query

Examples

GetTimezoneByID

Sample Request

GET https://atlas.microsoft.com/timezone/byId/json?subscription-key=[subscription-key]&api-version=1.0&options=all&query=Asia/Bahrain

Sample Response

{
  "Version": "2019a",
  "ReferenceUtcTimestamp": "2019-06-19T21:51:36.8299953Z",
  "TimeZones": [
    {
      "Id": "Asia/Qatar",
      "Aliases": [
        "Asia/Bahrain"
      ],
      "Countries": [
        {
          "Name": "Qatar",
          "Code": "QA"
        },
        {
          "Name": "Bahrain",
          "Code": "BH"
        }
      ],
      "Names": {
        "ISO6391LanguageCode": "en",
        "Generic": "Arabian Time",
        "Standard": "Arabian Standard Time",
        "Daylight": "Arabian Daylight Time"
      },
      "ReferenceTime": {
        "Tag": "+03",
        "StandardOffset": "03:00:00",
        "DaylightSavings": "00:00:00",
        "WallTime": "2019-06-20T00:51:36.8299953+03:00",
        "PosixTzValidYear": 2019,
        "PosixTz": "<+03>-3"
      },
      "RepresentativePoint": {
        "Latitude": 25.283333333333335,
        "Longitude": 51.533333333333331
      },
      "TimeTransitions": [
        {
          "Tag": "+03",
          "StandardOffset": "03:00:00",
          "DaylightSavings": "00:00:00",
          "UtcStart": "1972-05-31T20:00:00Z",
          "UtcEnd": "9999-12-31T23:59:59.9999999Z"
        }
      ]
    }
  ]
}
{
  "error": {
    "code": "400 BadRequest",
    "message": "Bad request: one or more parameters were incorrectly specified or are mutually exclusive."
  }
}
{
  "error": {
    "code": "401 Unauthorized",
    "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription."
  }
}
{
  "error": {
    "code": "403 Forbidden",
    "message": "Permission, capacity, or authentication issues."
  }
}
{
  "error": {
    "code": "404 NotFound",
    "message": "Not Found: the requested resource could not be found, but it may be available again in the future."
  }
}
{
  "error": {
    "code": "500 InternalServerError",
    "message": "An error occurred while processing the request. Please try again later."
  }
}

Definitions

Country

A country record.

Error

This object is returned when an error occurs in the Maps API

ErrorResponse

This response object is returned when an error occurs in the Maps API

JsonFormat

Desired format of the response. Only json format is supported.

Names

Timezone names object.

ReferenceTimeById

Details in effect at the local time.

RepresentativePoint

Representative point property

TimeTransition
TimezoneById
TimezoneByIdResult

This object is returned from a successful Timezone By ID call

TimezoneOptions

Alternatively, use alias "o". Options available for types of information returned in the result.

Country

A country record.

Name Type Description
Code
  • string

ISO-3166 2-letter country code for the country.

Name
  • string

Country Name

Error

This object is returned when an error occurs in the Maps API

Name Type Description
code
  • string

The HTTP status code.

message
  • string

If available, a human readable description of the error.

ErrorResponse

This response object is returned when an error occurs in the Maps API

Name Type Description
error

This object is returned when an error occurs in the Maps API

JsonFormat

Desired format of the response. Only json format is supported.

Name Type Description
json
  • string

The JavaScript Object Notation Data Interchange Format

Names

Timezone names object.

Name Type Description
Daylight
  • string

Daylight Name

Generic
  • string

Generic Name

ISO6391LanguageCode
  • string

The ISO 639-1 language code of the Names

Standard
  • string

Standard Name

ReferenceTimeById

Details in effect at the local time.

Name Type Description
DaylightSavings
  • string

Time saving in minutes in effect at the ReferenceUTCTimestamp.

PosixTz
  • string

POSIX string used to set the time zone environment variable.

PosixTzValidYear
  • integer

The year this POSIX string is valid for. Note: A POSIX string will only be valid in the given year.

StandardOffset
  • string

UTC offset in effect at the ReferenceUTCTimestamp.

Tag
  • string

Time zone name in effect at the reference timestamp (i.e. PST or PDT depending whether Daylight Savings Time is in effect).

WallTime
  • string

Current wall time at the given time zone as shown in the Tag property.

RepresentativePoint

Representative point property

Name Type Description
Latitude
  • number

Latitude property

Longitude
  • number

Longitude property

TimeTransition

Name Type Description
DaylightSavings
  • string

DaylightSavings property

StandardOffset
  • string

StandardOffset property

Tag
  • string

Tag property

UtcEnd
  • string

End date, end time for this transition period

UtcStart
  • string

Start date, start time for this transition period

TimezoneById

Name Type Description
Aliases
  • string[]

An array of time zone ID aliases.  Only returned when [options]=zoneinfo or all.

Note: may be null.

Countries

An array of country records. Only returned when [options]=zoneinfo or all.

Id
  • string

Id property

Names

Timezone names object.

ReferenceTime

Details in effect at the local time.

RepresentativePoint

Representative point property

TimeTransitions

Time zone DST transitions from [transitionsFrom] until timestamp + 1 year.

TimezoneByIdResult

This object is returned from a successful Timezone By ID call

Name Type Description
Count
  • number

Count property

ReferenceUtcTimestamp
  • string

Reference Utc Timestamp property

TimeZones

TimeZoneById array

Version
  • string

Version property

TimezoneOptions

Alternatively, use alias "o". Options available for types of information returned in the result.

Name Type Description
all
  • string

Include both zoneinfo and transitions in the result.

none
  • string

Do not include zoneinfo or transitions in the result.

transitions
  • string

Include transition information in the result (The number of transitions is currently capped at 250).

zoneInfo
  • string

Include additional time zone info in the result.