api-ninjas-com World Time API
The World Time API provides the current date and time for any city, latitude/longitude coordinates or timezone in the world.
The World Time API provides the current date and time for any city, latitude/longitude coordinates or timezone in the world.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-world-time-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Ninjas World Time API
description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
version: 1.0.0
contact:
name: API Ninjas
url: https://api-ninjas.com
license:
name: Proprietary
servers:
- url: https://api.api-ninjas.com
description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: World Time
description: The World Time API provides the current date and time for any city, latitude/longitude coordinates or timezone in the world.
paths:
/v1/worldtime:
get:
summary: Get the current date and time
description: Get the current date and time by city/state/country, location coordinates (latitude/longitude), or timezone.
operationId: getWorldTime
parameters:
- $ref: '#/components/parameters/WorldTimeOpenapi_lat'
- $ref: '#/components/parameters/WorldTimeOpenapi_lon'
- $ref: '#/components/parameters/WorldTimeOpenapi_city'
- $ref: '#/components/parameters/WorldTimeOpenapi_state'
- $ref: '#/components/parameters/WorldTimeOpenapi_country'
- $ref: '#/components/parameters/WorldTimeOpenapi_timezone'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/WorldTimeResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/WorldTimeOpenapi_ErrorResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/WorldTimeOpenapi_ErrorResponse'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/WorldTimeOpenapi_ErrorResponse'
security:
- ApiKeyAuth: []
tags:
- World Time
components:
schemas:
WorldTimeOpenapi_ErrorResponse:
type: object
properties:
message:
type: string
WorldTimeResponse:
type: object
properties:
timezone:
type: string
example: Europe/London
datetime:
type: string
example: '2022-09-18 19:16:43'
date:
type: string
example: '2022-09-18'
year:
type: string
example: '2022'
month:
type: string
example: 09
day:
type: string
example: '18'
hour:
type: string
example: '19'
minute:
type: string
example: '16'
second:
type: string
example: '43'
day_of_week:
type: string
example: Sunday
utc_offset:
type: string
description: Offset from UTC currently in effect at the location, formatted as +HH:MM or -HH:MM.
example: +01:00
utc_datetime:
type: string
description: The same instant expressed in UTC, in ISO 8601 format.
example: '2022-09-18T18:16:43+00:00'
unixtime:
type: integer
format: int64
description: Unix epoch timestamp in seconds.
example: 1663528603
abbreviation:
type: string
description: Timezone abbreviation currently in effect (for example BST or EST).
example: BST
dst:
type: boolean
description: true if daylight saving time is currently in effect at the location.
example: true
day_of_year:
type: integer
description: Day of the year as an integer between 1 and 366.
example: 261
week_number:
type: integer
description: ISO 8601 week number.
example: 37
business_day_result:
type: object
description: Returned when add_business_days is set. Premium only.
properties:
start_date:
type: string
example: '2026-12-24'
business_days_added:
type: integer
example: 3
result_date:
type: string
example: '2026-12-31'
result_day_of_week:
type: string
example: Thursday
skipped_weekend_days:
type: integer
example: 2
skipped_holidays:
type: array
items:
type: object
properties:
date:
type: string
example: '2026-12-25'
name:
type: string
example: Christmas Day
business_days_between:
type: object
description: Returned when business_days_between is set. Premium only.
properties:
start_date:
type: string
example: '2026-12-20'
end_date:
type: string
example: '2027-01-05'
business_days:
type: integer
example: 8
weekend_days:
type: integer
example: 5
holidays:
type: array
items:
type: object
properties:
date:
type: string
example: '2026-12-25'
name:
type: string
example: Christmas Day
description: Holidays that fell in the range.
business_hours:
type: object
description: Returned when business_hours is set. Premium only.
properties:
is_open:
type: boolean
example: true
reason:
type:
- string
- 'null'
example: null
opens:
type: string
example: 09:00
closes:
type: string
example: '17:00'
next_open:
type: string
example: '2026-12-29 09:00:00'
next_close:
type: string
example: '2026-12-24 17:00:00'
dst_transitions:
type: array
description: The next daylight-saving transitions for the location. Returned when at is set. Premium only.
items:
type: object
properties:
transition_utc:
type: string
example: '2027-03-28T01:00:00+00:00'
utc_offset:
type: string
example: +01:00
dst:
type: boolean
example: true
abbreviation:
type: string
example: BST
parameters:
WorldTimeOpenapi_city:
name: city
in: query
required: false
description: City name. Premium subscribers only.
schema:
type: string
WorldTimeOpenapi_country:
name: country
in: query
required: false
description: Country name. Premium subscribers only.
schema:
type: string
WorldTimeOpenapi_lat:
name: lat
in: query
required: false
description: Latitude of desired location. Premium subscribers only.
schema:
type: string
WorldTimeOpenapi_timezone:
name: timezone
in: query
required: false
description: Timezone name (e.g. Europe/London).
schema:
type: string
WorldTimeOpenapi_lon:
name: lon
in: query
required: false
description: Longitude of desired location. Premium subscribers only.
schema:
type: string
WorldTimeOpenapi_state:
name: state
in: query
required: false
description: US state (for United States cities only). Premium subscribers only.
schema:
type: string
securitySchemes:
ApiKeyAuth:
type: apiKey
in: header
name: X-Api-Key
externalDocs:
description: API Ninjas documentation
url: https://api-ninjas.com/api