Skip to content

Time and Date API: Get sunrise and sunset

Gets 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 (opens in a new tab)Version 1ReadNo sign-inVerified Nov 2, 2026

Unofficial. Not affiliated with or endorsed by Time and Date.

Inputs

Values from the run on Oct 31, 2026, shown under Output.

Date optionaldate

First local calendar date (YYYY-MM-DD), for example 2026-06-20. Defaults to today in the matched place.

2026-11-25

Days optionaldays

Number of consecutive days, for example 3. Defaults to 1.

31

Whole number from 1 to 31. Default 1.

Location, requiredlocation

City or place to look up, for example Reykjavik. A Time and Date /sun/ page URL or place id also works.

New Delhi

Output

From a run on Oct 31, 2026, shortened for this page.
{  "days": [    {      "date": "2026-11-25",      "note": null,      "sunset": "2026-11-25T17:24+05:30",      "sunrise": "2026-11-25T06:51+05:30",      "page_url": "https://www.timeanddate.com/sun/india/new-delhi?month=11&year=2026",      "day_length": "10 h 32 min",      "solar_noon": "2026-11-25T12:08+05:30",      "civil_twilight_end": "2026-11-25T17:49+05:30",      "civil_twilight_start": "2026-11-25T06:26+05:30"    },    {      "date": "2026-11-26",      "note": null,      "sunset": "2026-11-26T17:24+05:30",      "sunrise": "2026-11-26T06:52+05:30",      "page_url": "https://www.timeanddate.com/sun/india/new-delhi?month=11&year=2026",      "day_length": "10 h 32 min",      "solar_noon": "2026-11-26T12:08+05:30",      "civil_twilight_end": "2026-11-26T17:49+05:30",      "civil_twilight_start": "2026-11-26T06:26+05:30"    },    {      "date": "2026-11-27",      "note": null,      "sunset": "2026-11-27T17:24+05:30",      "sunrise": "2026-11-27T06:53+05:30",      "page_url": "https://www.timeanddate.com/sun/india/new-delhi?month=11&year=2026",      "day_length": "10 h 31 min",      "solar_noon": "2026-11-27T12:08+05:30",      "civil_twilight_end": "2026-11-27T17:49+05:30",      "civil_twilight_start": "2026-11-27T06:27+05:30"    }  ],  "place": "New Delhi, Delhi, India"}
Price
1 credit per completed run (1¢ with pay as you go); failed runs are free.
Method
timeanddate.com/get_sunrise_and_sunset
Returns
place, per day: sunrise, sunset, solar noon, day length, civil twilight start/end, note, page URL

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_sunrise_and_sunset with the inputs above.

Ask your agent

  • What time does the sun rise and set in Reykjavik on 2026-06-20?
  • I need sunrise, sunset and civil twilight times for Tromsø for the 7 days starting December 15, 2025 — flag any days where the sun doesn't rise at all.
  • Pull the day length and solar noon for Cape Town for each day from March 1 to March 10, 2026 using timeanddate.com.
  • Planning a golden-hour photo shoot in Santorini next week — when is sunset on 2026-05-12 and 2026-05-13, and when does civil twilight end?
  • Check Time and Date for today's sunrise and sunset in Anchorage, Alaska, with the UTC offset included.
  • 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.

    timeanddate.com/get_time_in_city
  • Converts 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_cities
  • Counts 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_days
  • Gets The Weather Channel's daily forecast for a city, address, ZIP code or postcode: up to 15 upcoming days with highs, lows, conditions, rain chance, wind, humidity, UV and sun times.

    weather.com/get_daily_forecast
  • Finds the nearest NOAA tide prediction station to a US coastal place (within 30 miles) and returns its high and low tide times in local time with predicted heights above MLLW.

    tidesandcurrents.noaa.gov/get_tide_times
  • Gets daily weather and time-ordered airport observations for a past date near a city, airport, or ZIP code. Summary averages use the available observations; missing measurements are null.

    wunderground.com/get_historical_weather
  • Gets up to 10 days of MSN Weather forecasts for a city, address, or ZIP code, with optional hourly forecasts for the next 24 hours.

    msn.com/get_forecast
  • Finds 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_sightings