一个用于跟踪日出和日落时间的命令行程序
a command-line program for tracking sunrise and sunset times (Mac / Linux / Windows)
It tells you the sunrise, sunset, solar noon times and day length. It also projects these changes over the next ten days.
daylight uses your IP-based location and timezone to tailor the results to your geometry. It works in (ant)arctic
locations, and you can override the IP location if you're travelling / on a VPN.
I love the sunlight and dread the long, dark winter evenings of Northern Europe. I often look up sunrise / sunset times and count off the days until the dreary darkness is gone.
(IP lookup is powered by https://ipinfo.io. They provide a good service so please don't spam requests.)
Daylight is provided under the GPL license.
# Add my tap (formula repository)
brew tap jbreckmckye/formulae
# Install daylight
brew install daylight
# Check it
daylight --helpYou might need to run brew trust --formula jbreckmckye/formulae/daylight
Pick up the executable for your system in the releases.
Unzip the package and put the program in a folder that's within your system PATH.
# Today's data for your IP location
daylight
# Override the IP location and timezone (allows offline operation)
daylight --latitude="-33.92" --longitude="18.42" --timezone="Africa/Johannesburg"
# Short summary of the data
daylight --short
# JSON version of summary
daylight --json
# Data for another date
daylight --date="2025-12-31"
# Disable the colour output
NO_COLOR=true daylight
# Show help
daylight --helpDaylight will attempt to adapt to your terminal background colour (dark vs light) but this might not work well for your
colour scheme. In this case you can use NO_COLOR to disable any colours
…There is also a short summary mode
$ daylight --short
Rises: 05:41
Sets: 20:14
Length: 14 hrs, 32 mins
Change: +3m 39sAnd a JSON mode
$ daylight --json
{
"rises": "06:04",
"noon": "13:06",
"sets": "20:09",
"length": "14 hrs, 4 mins",
"change": "-3m 57s",
"latitude": "52.953600",
"longitude": "-1.150500",
"timezone": "Europe/London"
}This project comes from pretty early in my journey to learn Go. It's always possible there are bugs. Feel free to raise issues.
The terminal UI library is lipgloss.
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠸⣷⣦⣀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣦⠀⠠⠾⠿⣿⣷⠀⠀⠀⠀⠀⣠⣤⣄⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠟⢉⣠⣤⣶⡆⠀⣠⣈⠀⢀⣠⣴⣿⣿⠋⠀⠀⠀⠀
⠀⢀⡀⢀⣀⣀⣠⣤⡄⢀⣀⡘⣿⣿⣿⣷⣼⣿⣿⣷⡄⠹⣿⡿⠁⠀⠀⠀⠀⠀
⠀⠀⠻⠿⢿⣿⣿⣿⠁⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣁⠀⠋⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠈⠻⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢰⣄⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣠⡀⠀⣴⣿⣿⣿⣿⣿⣿⣿⡿⢿⡿⠀⣾⣿⣿⣿⣿⣶⡄⠀
⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠻⣿⣿⡿⠻⣿⣿⣿⣿⠀⠀⠈⠉⠉⠉⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣠⣾⡿⠟⠉⠉⠀⢀⡉⠁⠀⠛⠛⢉⣠⣴⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⢸⣿⣿⡿⠉⠀⠙⠿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⠁⠀⠀⠀⠀⠀⠙⠿⣷⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀ ⠃⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀暂无开放 Issues,或尚未同步最近议题。