Reference: List Time Zone

http://api.timezonedb.com/v2.1/list-time-zone

List out all available time zones supported by TimeZoneDB.

Other End Points

Parameters

Parameter Description
key
REQUIRED
Your unique API key you get after register your account.
format
OPTIONAL
The response format from API. It can be either xml or json.

DEFAULT: xml
callback
OPTIONAL
Use for JavaScript JSON callback.
fields
OPTIONAL
Customize the field to display in response. Use commas ("," without spaces) to separate the field names.

FIELDS: countryCode, countryName, zoneName, gmtOffset, dst, timestamp
DEFAULT: countryCode, countryName, zoneName, gmtOffset, timestamp
country
OPTIONAL
A valid ISO 3166 country code. Only time zones of provided country will list out.
zone
OPTIONAL
The name of a time zone. Use asterisk (*) for wildcard search.

Responses

Field Description
status Status of the API query. Either OK or FAILED.
message Error message. Empty if no error.
countryCode Country code of the time zone.
countryName Country name of the time zone.
zoneName The time zone name.
gmtOffset The time offset in seconds based on UTC time.
gmtOffset The time offset in seconds based on UTC time.
dst Whether Daylight Saving Time (DST) is used. Either 0 (No) or 1 (Yes).
timestamp Current local time in Unix time. Minus the value with gmtOffset to get UTC time.

Usage Examples

Get all time zones supported by TimeZoneDB

Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=xml
Response
<?xml version="1.0" encoding="UTF-8"?>
<result>
	<status>OK</status>
	<message/>
	<zones>
		<zone>
			<countryCode>AD</countryCode>
			<countryName>Andorra</countryName>
			<zoneName>Europe/Andorra</zoneName>
			<gmtOffset>7200</gmtOffset>
			<timestamp>1464453737</timestamp>
		</zone>
		<zone>
			<countryCode>AE</countryCode>
			<countryName>United Arab Emirates</countryName>
			<zoneName>Asia/Dubai</zoneName>
			<gmtOffset>14400</gmtOffset>
			<timestamp>1464460937</timestamp>
		</zone>
		<zone>
			<countryCode>AF</countryCode>
			<countryName>Afghanistan</countryName>
			<zoneName>Asia/Kabul</zoneName>
			<gmtOffset>16200</gmtOffset>
			<timestamp>1464462737</timestamp>
		</zone>
		.
		.
		.
	</zones>
</result>
Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=json
Response
{
	"status":"OK",
	"message":"",
	"zones":[
		{
			"countryCode":"AD",
			"countryName":"Andorra",
			"zoneName":"Europe\/Andorra",
			"gmtOffset":7200,
			"timestamp":1464453737
		},
		{
			"countryCode":"AE",
			"countryName":"United Arab Emirates",
			"zoneName":"Asia\/Dubai",
			"gmtOffset":14400,
			"timestamp":1464460937
		},
		{"
			countryCode":"AF",
			"countryName":"Afghanistan",
			"zoneName":"Asia\/Kabul",
			"gmtOffset":16200,
			"timestamp":1464462737
		}
		.
		.
		.
	]
}

 

Get all time zones in New Zealand

Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=xml&country=NZ
Response
<?xml version="1.0" encoding="UTF-8"?>
<result>
	<status>OK</status>
	<message/>
	<zones>
		<zone>
			<countryCode>NZ</countryCode>
			<countryName>New Zealand</countryName>
			<zoneName>Pacific/Auckland</zoneName>
			<gmtOffset>43200</gmtOffset>
			<timestamp>1464537416</timestamp>
		</zone>
		<zone>
			<countryCode>NZ</countryCode>
			<countryName>New Zealand</countryName>
			<zoneName>Pacific/Chatham</zoneName>
			<gmtOffset>45900</gmtOffset>
			<timestamp>1464540116</timestamp>
		</zone>
	</zones>
</result>
Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=json&country=NZ
Response
{
	"status":"OK",
	"message":"",
	"zones":[
		{
			"countryCode":"NZ",
			"countryName":"New Zealand",
			"zoneName":"Pacific\/Auckland",
			"gmtOffset":43200,
			"timestamp":1464537416
		},
		{
			"countryCode":"NZ",
			"countryName":"New Zealand",
			"zoneName":"Pacific\/Chatham",
			"gmtOffset":45900,
			"timestamp":1464540116
		}
	]
}

 

Get all time zones in United States where zone name contains "New"

Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=xml&country=US&zone=*New*
Response
<?xml version="1.0" encoding="UTF-8"?>
<result>
	<status>OK</status>
	<message/>
	<zones>
		<zone>
			<countryCode>US</countryCode>
			<countryName>United States</countryName>
			<zoneName>America/New_York</zoneName>
			<gmtOffset>-14400</gmtOffset>
			<timestamp>1464480694</timestamp>
		</zone>
		<zone>
			<countryCode>US</countryCode>
			<countryName>United States</countryName>
			<zoneName>America/North_Dakota/New_Salem</zoneName>
			<gmtOffset>-18000</gmtOffset>
			<timestamp>1464477094</timestamp>
		</zone>
	</zones>
</result>
Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=json&country=US&zone=*New*
Response
{
	"status":"OK",
	"message":"",
	"zones":[
		{
			"countryCode":"US",
			"countryName":"United States",
			"zoneName":"America\/New_York",
			"gmtOffset":-14400,
			"timestamp":1464480694
		},
		{
			"countryCode":"US",
			"countryName":"United States",
			"zoneName":"America\/North_Dakota\/New_Salem",
			"gmtOffset":-18000,
			"timestamp":1464477094
		}
	]
}

 

Customize which field to show in result

Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=xml&zone=Asia/Tokyo&fields=zoneName,gmtOffset
Response
<?xml version="1.0" encoding="UTF-8"?>
<result>
	<status>OK</status>
	<message/>
	<zones>
		<zone>
			<zoneName>Asia/Tokyo</zoneName>
			<gmtOffset>32400</gmtOffset>
		</zone>
	</zones>
</result>
Query
http://api.timezonedb.com/v2.1/list-time-zone?key=YOUR_API_KEY&format=json&zone=Asia/Tokyo&fields=zoneName,gmtOffset
Response
{
	"status":"OK",
	"message":"",
	"zones":[
		{
			"zoneName":"Asia\/Tokyo",
			"gmtOffset":32400
		}
	]
}