WorldTimeAPI
worldtimeapi.org · Developer Tools
Simple timezone and current time API — get current UTC time, local time for any timezone, DST info, and UTC offset. No API key required.
Authentication
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Get time by timezone
Get current time in New York.
https://worldtimeapi.org/api/timezone/America/New_York
Hover any highlighted part to learn what it does
curl -X GET "https://worldtimeapi.org/api/timezone/America/New_York"
import requests
response = requests.get(
"https://worldtimeapi.org/api/timezone/America/New_York",
)
print(response.json())const url = 'https://worldtimeapi.org/api/timezone/America/New_York'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://worldtimeapi.org/api/timezone/America/New_York"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://worldtimeapi.org/api/timezone/America/New_York")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://worldtimeapi.org/api/timezone/America/New_York";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET
List all timezones
List all available timezone identifiers.
https://worldtimeapi.org/api/timezone
Hover any highlighted part to learn what it does
curl -X GET "https://worldtimeapi.org/api/timezone"
import requests
response = requests.get(
"https://worldtimeapi.org/api/timezone",
)
print(response.json())const url = 'https://worldtimeapi.org/api/timezone'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://worldtimeapi.org/api/timezone"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://worldtimeapi.org/api/timezone")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://worldtimeapi.org/api/timezone";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Any timezone: GET https://worldtimeapi.org/api/timezone/Europe/London
- Your IP timezone: GET https://worldtimeapi.org/api/ip
- List zones: GET https://worldtimeapi.org/api/timezone
- Zones follow IANA format: America/New_York, Asia/Tokyo, etc.