Time and Date API: Get time in city
Gets the current local time, time zone, and next daylight saving change for a city listed on Time and Date. Add a state or country to distinguish cities with the same name.
Unofficial. Not affiliated with or endorsed by Time and Date.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- City, required
city City name, with a state or country if needed, for example "Portland, Oregon".
Sydney
Input as JSON
{ "city": "Sydney"}Output
{ "city": "Sydney", "link": "https://www.timeanddate.com/worldclock/australia/sydney" , "country": "Australia", "local_date": "2026-09-29", "local_time": "2026-09-29T14:39:54+10:00", "utc_offset": "UTC+10", "time_zone_name": "Australian Eastern Standard Time", "local_time_text": "Tuesday, 2:39 PM", "time_zone_abbreviation": "AEST", "next_daylight_saving_change": "2026-10-04T02:00:00+10:00", "daylight_saving_time_in_effect": false}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"timeanddate.com/get_time_in_city","input":{"city":"Sydney"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "timeanddate.com/get_time_in_city" , "input": { "city": "Sydney" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "timeanddate.com/get_time_in_city" , "input": { "city": "Sydney" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run timeanddate.com/get_time_in_city# with {"city":"Sydney"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "city" ], "properties": { "city": { "type": "string", "description": "City name, with a state or country if needed, for example \"Portland, Oregon\"." } }}Output schema
{ "type": "object", "required": [ "city", "country", "local_date", "local_time", "local_time_text", "time_zone_name", "time_zone_abbreviation", "utc_offset", "daylight_saving_time_in_effect", "next_daylight_saving_change", "link" ], "properties": { "city": { "type": "string", "description": "City name." }, "link": { "type": "string", "description": "Time and Date city page." }, "country": { "type": "string", "description": "Country name." }, "local_date": { "type": "string", "format": "date", "description": "Local calendar date." }, "local_time": { "type": "string", "description": "Current local date and time in ISO 8601 with UTC offset." }, "utc_offset": { "type": "string", "description": "Current offset from UTC, such as UTC+9." }, "time_zone_name": { "type": "string", "description": "Current time zone name." }, "local_time_text": { "type": "string", "description": "Local day of week and time in readable form." }, "time_zone_abbreviation": { "type": "string", "description": "Current time zone abbreviation." }, "next_daylight_saving_change": { "type": [ "string", "null" ], "description": "Next daylight saving clock change, as the local scheduled date and time with the pre-change offset, or null if none is listed." }, "daylight_saving_time_in_effect": { "type": "boolean", "description": "Whether daylight saving time is now in effect." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
timeanddate.com/get_time_in_city- Returns
- city, country, local date and time, time zone name and abbreviation, UTC offset, DST status, next DST change, link
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method timeanddate.com/get_time_in_city with the inputs above.
Ask your agent
- What time is it right now in Auckland, New Zealand?
- Check timeanddate.com for the current local time and UTC offset in Portland, Maine
- Is Phoenix, Arizona observing daylight saving time right now, and what's its time zone abbreviation?
- When is the next clock change in Berlin, and what's the local time there now?
- Look up the current date and time in Hyderabad, India on Time and Date
See more
All Time and Date methodsConverts a meeting time in one city to local times in other cities, with time zones and 09:00-17:00 working-hours status. Supports dates from 1970 to 2030; ambiguous clock-change times use the first occurrence.
timeanddate.com/convert_time_between_citiesGets daily sunrise, sunset, solar noon, day length and civil twilight for a place from Time and Date, for one or more consecutive days. Times are local with UTC offset; days without sunrise or sunset are marked.
timeanddate.com/get_sunrise_and_sunsetCounts weekdays between two dates, excluding nationwide public holidays or, optionally, public holidays in a state or province, from Time and Date's published holiday calendar.
timeanddate.com/count_business_daysGets current conditions and today's high and low from The Weather Channel for a city, postcode, ZIP code or street address worldwide. Street addresses are geocoded exactly first; some observations omit gusts or other measurements.
weather.com/get_current_weatherGets a city's current Numbeo cost of living indices, monthly estimates without rent, and typical prices. Add a country or state to tell apart cities with the same name.
numbeo.com/get_cost_of_livingFinds upcoming International Space Station sightings for a city in NASA's city list, with local start times, visibility and sky directions. Cities without scheduled passes return an empty list.
nasa.gov/get_iss_sightingsGets current conditions and RealFeel for a city or postal code on AccuWeather. The UV level follows standard UV-index ranges. Air quality is null unless it is shown with the current conditions.
accuweather.com/get_current_weatherGets the latest observed weather from a nearby National Weather Service station for a US city, address, or ZIP code. Measurements the station does not report are null.
weather.gov/get_current_conditions