Overview

The World Time API provides a simple way to get the current time for various timezones and locations. You can also get the current time based on your IP address.

API Schema

The API endpoints are designed to return information in JSON format by default. You can append .txt to get plain-text responses.

API Specifications

  • http://worldtimeapi.org/api/timezone - Request a list of valid timezones.
  • http://worldtimeapi.org/api/timezone/:area - Request a list of valid locations for an area.
  • http://worldtimeapi.org/api/timezone/:area/:location[/:region] - Request the current time for a specific timezone.
  • http://worldtimeapi.org/api/ip - Request the current time based on your public IP.
  • http://worldtimeapi.org/api/ip/:ipv4 - Request the current time for a specific IP address.

Usage Examples

Here are some example commands to interact with the API:

curl "http://worldtimeapi.org/api/timezone" curl "http://worldtimeapi.org/api/timezone/Europe" curl "http://worldtimeapi.org/api/timezone/America/Argentina/Salta" curl "http://worldtimeapi.org/api/timezone/Europe/London.txt" curl "http://worldtimeapi.org/api/ip" curl "http://worldtimeapi.org/api/ip/8.8.8.8.txt"

FAQs

What is the World Time API?

The World Time API provides time-related information for various locations around the world. It helps developers get the current time based on timezones or IP addresses.

How do I get the current time for a specific location?

Use the endpoint http://worldtimeapi.org/api/timezone/:area/:location[/:region] where :area, :location, and :region are placeholders for the desired values.

Can I get the time in plain text?

Yes, by appending .txt to any API URL, you can receive the response in plain text.