How to Calculate Sunrise and Sunset Times
Enter a latitude, longitude, and optional date to get estimated sunrise and sunset times in UTC. When both events are available, the result also includes day length and estimated solar noon.
Overview
Use the Sunrise & Sunset calculator to estimate when the sun rises and sets for a location on a selected date. The results use UTC, not the location’s local clock time, so they are useful when you need a consistent time basis for comparing places or dates. When both events are available, the calculator also reports day length and an estimated solar-noon time.
You provide a latitude, a longitude, and optionally a date. If you leave the coordinates blank, the calculator uses 40.7128 latitude and -74.0060 longitude. If you leave the date blank, it uses the current UTC date. This makes a quick check possible without entering every value, while still allowing you to specify another location and date.
Steps
- Enter the location’s latitude as a number from -90 to 90. Positive and negative values identify the hemisphere through the result’s latitude direction, with zero treated as north.
- Enter the longitude as a number from -180 to 180. Zero is treated as east, and the result identifies the direction as E or W.
- Enter a date if you want a day other than the current UTC date. Use the
YYYY-MM-DDformat, such as2025-06-21. Some non-zero-padded month or day forms may also be accepted, but the four-digit year, two-digit month, and two-digit day format is the clearest choice. - Submit the values to calculate the result. Check that the date and coordinates are valid before relying on the output.
- Read the sunrise and sunset times as UTC clock times. When both events are available, also review the numeric day length, the estimated solar-noon time, the calculation method, and the latitude and longitude directions.
For a repeatable comparison, keep the same time basis and enter each location with its coordinates rather than converting the displayed times to local time before comparing them.
Result interpretation
A normal result includes estimated sunrise and sunset times in UTC. The displayed event times and estimated solar-noon time are rounded to the nearest minute. Numeric day length is rounded to two decimal places, so it should be read as a rounded duration rather than a more precise measurement. The calculation method is identified as the NOAA sunrise equation, and the result includes the latitude and longitude directions used for the location.
If an entered coordinate is outside its allowed range, or the date cannot be parsed, the calculation is unsuccessful and solar times are not produced. A location and date can also have no valid sunrise or sunset event. In that case, the result reports a polar condition and leaves both event times unavailable; do not treat missing times as midnight or as a zero-length day.
Remember that UTC is the stated time basis. To use the result for a local schedule, convert the UTC values separately using the location’s applicable time-zone rules. The calculator provides an estimate, so the output is best used as an estimated reference for the selected coordinates and date.
Worked example
You want an estimated UTC sunrise and sunset reference for New York City on June 21, 2025.
Enter latitude 40.7128, longitude -74.0060, and date 2025-06-21, then submit the calculation.
The result should contain estimated sunrise and sunset clock times in UTC, numeric day length, estimated solar noon, the NOAA sunrise equation as the method, and latitude and longitude directions when both events are available.
Limitations
- The calculator provides an estimate rounded to the stated display precision, and some location-date combinations have no valid sunrise or sunset event.
Common errors
- A frequent input mistake is entering a latitude or longitude outside its permitted range, or using a date that cannot be parsed. Correct the coordinates and enter the date as
YYYY-MM-DDbefore submitting again.
FAQ
Are the sunrise and sunset times local time?
The displayed times use UTC, not local clock time. Convert them separately if you need a local schedule.
Does the calculator show day length?
When both sunrise and sunset are available, the result includes numeric day length. The value is rounded to two decimal places.
Why are sunrise and sunset times unavailable?
If either event has no valid calculation for the selected location and date, the result reports a polar condition and leaves both event times unavailable.