We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Sunrise and Sunset Times by City
If this tool helped you, you can buy us a coffee ☕
Accurately calculate sunrise and sunset times, as well as daylight hours, for any location worldwide. Supports 30 years of historical data.
View dawn, sunrise, solar noon, sunset, and dusk times for a specified city.
Enter a city to view sunrise and sunset times.
Ruby Code Formatter
Free online Ruby code formatter and beautifier. Automatically fix indentation, organize syntax, and instantly improve your code readability.

JSON to Ruby Class Converter
Automatically convert JSON data into Ruby class definitions. Generate code with properties and initialize methods for seamless integration into your Ruby projects.

Age Calculator (Western, Chinese & Lunar)
Enter your birth date to instantly calculate your exact age, traditional Chinese age, and total days alive, plus find your Chinese zodiac, horoscope, and lunar birthday.
Planning an outdoor activity but don't know the exact sunrise time? Based on the NOAA Solar Calculator astronomical algorithm, this tool accurately calculates the sunrise, sunset, solar noon, and daylight hours for a specific date by entering a city name or latitude/longitude coordinates. Daylight hours refer to the actual daytime between sunrise and sunset, including atmospheric refraction correction (standard value 0.833°), ensuring a calculation error of ≤±60 seconds.
When using decimal latitude and longitude, the latitude range is -90 to +90, and the longitude range is -180 to +180. It is recommended to keep 4 decimal places. Please use standard geographical names for cities (e.g., "Guangzhou") and avoid abbreviations to prevent matching errors. The results default to your browser's time zone; if you need a fixed time zone, please set it before calculating.
For photography enthusiasts, we recommend paying special attention to the "Civil Dawn" and "Civil Dusk" times (when the sun is 6° below the horizon), which are the best times for capturing the golden hour. Typical input/output example: Input "Shanghai 2024-12-21", output sunrise 06:50, sunset 16:59, daylight 10 hours 9 minutes, intuitively demonstrating the short daylight characteristics of the winter solstice.