About the Sunrise and Sunset Calculator
Photographers planning golden-hour shoots, travelers, farmers and anyone timing outdoor work or fasting needs accurate sunrise and sunset times. This sunrise sunset calculator works them out for any date and location, from a list of cities or your own coordinates, together with solar noon, day length and civil twilight, using the method published by the US National Oceanic and Atmospheric Administration. Local terrain and weather can shift what you actually see by a few minutes.
The calculation follows the solar position equations published by the US National Oceanic and Atmospheric Administration (NOAA). From the date it finds the Sun's declination and the equation of time, the difference between clock time and sundial time. Sunrise and sunset are when the center of the Sun is 0.833° below the horizon, which allows for the Sun's radius and the bending of light by the atmosphere; civil twilight uses 6° below. Times are given in the city's local time, including daylight saving time, or in the UTC offset you enter. Accuracy is about a minute for latitudes below 72°.
Example: in London on 21 June 2026, the summer solstice, the Sun rises at 04:43 and sets at 21:22 British Summer Time, giving 16 hours 38 minutes of daylight; on 21 December it rises at 08:04 and sets at 15:53, for under 8 hours. In Karachi on 8 October 2026, sunrise is at 06:27 and sunset at 18:12.
Hills, buildings and unusual weather can change the moment you actually see the Sun. For prayer times based on the Sun's position, use the prayer times calculator; for clock times elsewhere the world clock and time zone converter.
How to use the Sunrise and Sunset Calculator
- Choose a placePick a city, or enter latitude, longitude and UTC offset.
- Or use your locationTap the location button to fill in your coordinates.
- Pick a dateToday is filled in; choose any date.
- Read the timesSunrise, sunset, solar noon, day length and twilight.
Sunrise and Sunset Calculator features
- NOAA solar position method
- 45 city presets with local time zones
- Custom latitude, longitude and UTC offset
- Use your device's location
- Solar noon and day length
- Civil dawn and dusk
- Midnight sun and polar night detected
Common uses
- Planning photography at golden hour
- Hiking, fishing and outdoor trips
- Gardening and solar panel planning
- Religious and cultural observances
- Comparing daylight between cities
Sunrise and sunset in practice: Pakistani cities, prayer and fasting times, photography and solar power
Sunrise and sunset shape daily routines more than most people notice: when fasts begin and end, when farmers start work, when photographers get their best light and how much electricity solar panels produce. This guide compares day lengths in Karachi, Lahore and Gilgit through the year, explains the link with prayer and fasting times, covers twilight and golden hour, and explains why the earliest sunset is not on the shortest day.
A worked example: three cities
On 21 June 2026, around the summer solstice, the Sun rises in Lahore at about 4:58 am and sets at about 7:11 pm Pakistan time, giving roughly 14 hours 12 minutes of daylight. In Karachi, further south, the day is about 13 hours 41 minutes, and in Gilgit, further north, about 14 hours 36 minutes. On 21 December, the pattern reverses: Lahore has about 10 hours 6 minutes, Karachi about 10 hours 36 minutes and Gilgit only about 9 hours 43 minutes.
The further a place is from the equator, the greater the difference between summer and winter days.
Prayer and fasting times
Maghrib prayer begins at sunset, and in Ramadan the fast is broken at sunset, so iftar times follow the sunset time for each city. Fajr prayer, and the end of suhoor, are based on dawn, when the Sun is a set angle below the horizon, commonly 18 degrees in the method used widely in Pakistan, although other methods use different angles. Because these times depend on location, a city a few hundred kilometres away can have iftar several minutes earlier or later.
Twilight
Civil twilight is the period when the Sun is up to 6 degrees below the horizon, and there is usually enough light for outdoor activities without artificial lighting. Nautical and astronomical twilight follow, as the sky darkens further. Twilight is shorter near the equator and longer at high latitudes, which is why evenings in northern Europe in summer stay light so late.
Golden hour and blue hour
Photographers prize the hour after sunrise and the hour before sunset, often called golden hour, when light is warm and soft and shadows are long. The blue hour, during twilight, gives cool, even light that suits cityscapes. Planning a shoot with exact sunrise and sunset times, rather than guessing, makes the most of these short windows.
The earliest sunset
The shortest day of the year is around 21 December, but the earliest sunset comes in early December and the latest sunrise in early January. This happens because the Earth's tilted axis and elliptical orbit make solar noon drift slightly through the year. The effect, described by the equation of time, is why evenings start lengthening before mornings do.
Solar panels and daylight
Solar panels produce most of their energy around solar noon, and longer summer days mean more generation, although heat reduces panel efficiency somewhat. In winter, shorter days, a lower Sun and smog in northern cities can cut output noticeably. Knowing daylight hours through the year helps estimate how much a system will produce and when.
Refraction and the visible Sun
The atmosphere bends sunlight, so the Sun appears above the horizon when it is geometrically just below it. Standard sunrise and sunset times include an allowance for this and for the size of the Sun's disc, which is why times refer to the moment the upper edge of the Sun touches the horizon. Mountains and buildings can delay the moment you actually see the Sun.
Common mistakes
- Using another city's sunset time for iftar.
- Expecting the earliest sunset on the shortest day.
- Forgetting that hills and buildings change the visible sunrise.
- Ignoring daylight saving when checking times abroad.
Related tools
For prayer times based on the Sun's position, use Prayer Times Calculator. For moon phases, try Moon Phase Calculator, and to see live times in other cities, World Clock.
Outdoor work
Farmers, construction workers and others who work outdoors often plan the day around sunrise to avoid the hottest hours in summer. In Pakistani summers, starting soon after dawn and pausing in the early afternoon is common. Knowing sunrise times helps plan shifts and transport for outdoor workers.
Mountain trips
In the northern areas, mountains block the Sun for part of the day, so valleys can fall into shade long before the calculated sunset. Trekkers in Gilgit-Baltistan and Chitral should plan to reach camp well before sunset, because darkness and cold arrive quickly once the Sun drops behind a ridge.
Where the Sun rises
The Sun rises due east and sets due west only around the equinoxes. In June, it rises and sets well to the north of east and west, and in December well to the south. This matters for the orientation of homes, windows and solar panels, and for photographers planning a sunset over a landmark.
Limits
Times are calculated for a flat horizon using standard astronomical formulas and are usually accurate to within a minute or two.
Frequently asked questions
How is sunrise time calculated?
From the Sun's declination and the equation of time for the date, the calculator finds when the Sun's center is 0.833° below the horizon at your latitude, then converts solar time to your clock time using your longitude and time zone.
What is solar noon?
The moment the Sun is highest in the sky, halfway between sunrise and sunset. It is rarely 12:00 on the clock, because of your position within your time zone, daylight saving time and the equation of time.
What is civil twilight?
The period when the Sun is less than 6° below the horizon, before sunrise and after sunset. There is usually enough light for most outdoor activities without artificial light.
Why are sunrise and sunset not equally far from noon on the clock?
Because of the equation of time: the Earth's tilted axis and elliptical orbit make solar noon drift by up to about 16 minutes across the year, so the clock times shift around.
When is the longest day of the year?
Around 20 or 21 June in the Northern Hemisphere and 21 or 22 December in the Southern Hemisphere: the solstices. The earliest sunrise and latest sunset fall a few days either side.
What are the midnight sun and polar night?
Above the Arctic Circle and below the Antarctic Circle, the Sun stays up all day around midsummer and does not rise around midwinter. The calculator says when either happens.
How accurate are these times?
Within about a minute for most places below 72° latitude. Real sunrise can differ by a minute or two because of atmospheric conditions, and mountains or buildings on the horizon delay what you see.
Does the calculator include daylight saving time?
Yes, for the city presets: the times use each city's official time zone rules for the chosen date. For custom coordinates, enter the UTC offset that applies on that date.