Daylight Calculator

Calculate daylight hours, sunrise, and sunset times for any location and date

Key Facts

Category
Geography & Science
Input Types
number, date
Output Type
json
Sample Coverage
1
API Ready
Yes

Overview

The Daylight Calculator computes precise daylight hours, sunrise, and sunset times for any global location and date. Input latitude, longitude, and a date to receive accurate astronomical data in JSON format.

When to Use

  • When planning outdoor events or activities that rely on natural light conditions.
  • For astronomy or stargazing to determine optimal observation windows based on daylight.
  • In agriculture or gardening to schedule tasks like planting or harvesting according to daylight exposure.

How It Works

  • Enter the latitude coordinate (-90 to 90) for your location.
  • Input the longitude coordinate (-180 to 180) for your location.
  • Select the date for which you want to calculate daylight.
  • The tool processes the inputs using astronomical algorithms and returns results including sunrise, sunset, and daylight duration in JSON.

Use Cases

Scheduling photography sessions to capture sunrise or sunset lighting.
Assessing solar energy potential by analyzing daylight hours for a location.
Planning outdoor sports or recreation activities based on available daylight.

Examples

1. Summer Solstice Daylight in New York

Event Planner
Background
An event planner is organizing an outdoor festival in New York City on June 21st, the longest day of the year.
Problem
Need exact sunrise and sunset times to schedule activities from dawn to dusk.
How to Use
Set latitude to 40.7128, longitude to -74.0060, and date to 2026-06-21.
Outcome
The tool returns JSON with sunrise at 5:25 AM UTC, sunset at 8:30 PM UTC, and 15 hours and 5 minutes of daylight.

2. Winter Daylight for Gardening in Seattle

Home Gardener
Background
A gardener in Seattle wants to plan winter planting on December 21st, the shortest day, to choose plants suited to low light.
Problem
Determine daylight duration to select plants that thrive with limited sunlight exposure.
How to Use
Input latitude 47.6062, longitude -122.3321, and date 2026-12-21.
Outcome
Results show sunrise at 7:55 AM UTC, sunset at 4:20 PM UTC, with 8 hours and 25 minutes of daylight.

Try with Samples

astronomy

FAQ

How accurate are the daylight calculations?

Calculations are based on standard astronomical formulas and are highly accurate for most practical purposes.

Can I use this tool for historical or future dates?

Yes, you can input any valid date, past or future, within the tool's supported range.

What if I don't know my exact coordinates?

Use online maps or geolocation tools to find the latitude and longitude for your specific location.

Are the output times adjusted for my time zone?

Output times are provided in UTC; you may need to convert them to your local time zone manually.

Can I calculate daylight for multiple dates at once?

No, the tool processes one date per calculation; run it separately for each date you need.

API Documentation

Request Endpoint

POST /en/api/tools/daylight-calculator

Request Parameters

Parameter Name Type Required Description
latitude number Yes -
longitude number Yes -
date date Yes -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-daylight-calculator": {
      "name": "daylight-calculator",
      "description": "Calculate daylight hours, sunrise, and sunset times for any location and date",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=daylight-calculator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]