Interactive Day Night World Map with Real-Time Terminator

Written by:
PK

Wondering what parts of Earth are experiencing a sunrise, sunset, or even the deep night right now? Our interactive day/night world map shows the real-time terminator line (boundary between day and night) along with detailed twilight zones that reveal the subtle transitions between day and night.

Features of the Day-Night Map

Click anywhere on the map to get precise sunrise and sunset times, local time, and current sun position for that location. The tool includes timezone detection for 150,000+ cities worldwide – or anywhere on land, really – and lets you explore how Earth's terminator moves throughout any day of the year.

Day/night map for Boston, MA at 8 PM in August
  • Real-Time Terminator Line - The gray line shows Earth's day/night boundary, updating automatically as our planet rotates. Areas in shadow are experiencing night, while areas in light are still in a day.
  • City Time Display - Blue dots mark major cities worldwide. Hover over any city (tap on mobile) to see local time, timezone, and current sun phase.
  • Click for Sun Data - Click anywhere to get detailed information including exact sunrise/sunset times, solar noon, daylight duration, and current sun elevation/azimuth angles. (Similar to our solar tracker map)
  • City Search - Search from 150,000+ cities worldwide using the search box. Try "Paris", "Tokyo, JP", or "San Francisco, CA, US" for different formats.
  • Time Controls - The time slider lets you explore terminator and day/night positions throughout any day. The date picker allows you to see seasonal changes - try December 21st (winter solstice) vs June 21st (summer solstice) to see dramatic differences in polar regions.
  • Twilight Zones - The tool also draws 4 additional terminators, representing sunrise/sunset, civil twilight, nautical twilight, and astronomical twilight. Civil twilight is when the sun is 6° below the horizon. Nautical twilight (-12°) is when horizon lines become difficult to distinguish at sea. Astronomical twilight (-18°) marks when it is dark enough for stargazing. I've set sunrise and sunset to be when the sun is between 0 and 6 degrees off the horizon.
Input bars for the day/night world map.

Methodology

The day/night map uses several open-source libraries and datasets to ensure astronomical accuracy:

  • SunCalc - Provides precise sun position calculations and sunrise/sunset times
  • Leaflet - Powers the interactive map interface
  • Leaflet.Terminator - Calculates and renders the day/night boundary line (and the terminator code for the sunset and sunrise, plus the three twilight terminators, are based on Jörg Dietrich's code)
  • tzf-wasm - Enables fast coordinate-to-timezone lookups
  • Timezone Boundary Builder - Provides the underlying geographic timezone data for tzf-wasm – I couldn't have done the timezone detection without it!

The terminator calculation uses astronomical formulas accounting for Earth's orbital position, axial tilt, and rotation, based on the Leaflet Terminator library. Twilight zones are computed based on sun elevation angles relative to the horizon.

      

PK

PK started DQYDJ in 2009 to research and discuss finance and investing and help answer financial questions. He's expanded DQYDJ to build visualizations, calculators, and interactive tools.

PK lives in New Hampshire with his wife, kids, and dog.

Don't Quit Your Day Job...

DQYDJ may be compensated by our partners if you make purchases through links. See our disclosures page. As an Amazon Associate we earn from qualifying purchases.
Sign Up For Emails
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram