2025-03-09 08:21:00
github.com
a command-line program for tracking sunrise and sunset times (Mac / Linux)
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.)
# Add my tap (formula repository)
brew tap jbreckmckye/formulae
# Install daylight
brew install daylight
# Check it
daylight --help
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
.
There is a Windows binary but I haven’t been able to test this. Let me know if you get it working.
# Today's data for your IP location
daylight
# Override the IP location and timezone
daylight -loc-"-33.92,18.42" --timezone "Africa/Johannesburg"
# Short summary of the data
daylight --short
# Data for another date
daylight --date="2025-12-31"
# Disable the colour output
NO_COLOR=true daylight
# Show help
daylight --help
Daylight 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
$ NO_COLOR=true daylight
Today's daylight
════════════════════════════════════════════════════════════════════════════
Rises Noon Sets
06:30 AM 12:11 PM 17:52 PM
Day length
════════════════════════════════════════════════════════════════════════════
Daylight for: versus yesterday:
11 hrs, 22 mins +3m 58s
....................R---------------------------------S..................
Ten day projection
════════════════════════════════════════════════════════════════════════════
┌────────────────┬──────────────┬──────────────┬─────────────────────┐
│ DATE │ SUNRISE │ SUNSET │ LENGTH │
├────────────────┼──────────────┼──────────────┼─────────────────────┤
│ Sun Mar 09 │ 06:28 AM │ 17:54 PM │ 11 hrs, 26 mins │
│ Mon Mar 10 │ 06:25 AM │ 17:55 PM │ 11 hrs, 30 mins │
│ Tue Mar 11 │ 06:23 AM │ 17:57 PM │ 11 hrs, 34 mins │
│ Wed Mar 12 │ 06:21 AM │ 17:59 PM │ 11 hrs, 37 mins │
│ Thu Mar 13 │ 06:19 AM │ 18:01 PM │ 11 hrs, 41 mins │
│ Fri Mar 14 │ 06:16 AM │ 18:02 PM │ 11 hrs, 45 mins │
│ Sat Mar 15 │ 06:14 AM │ 18:04 PM │ 11 hrs, 49 mins │
│ Sun Mar 16 │ 06:12 AM │ 18:06 PM │ 11 hrs, 53 mins │
│ Mon Mar 17 │ 06:09 AM │ 18:07 PM │ 11 hrs, 57 mins │
│ Tue Mar 18 │ 06:07 AM │ 18:09 PM │ 12 hrs, 1 mins │
└────────────────┴──────────────┴──────────────┴─────────────────────┘
Your stats
════════════════════════════════════════════════════════════════════════════
LOCATION Latitude 51.51, Longitude -0.1257 IP ADDRESS 146.90.4.96
There is also a short summary mode
$ daylight --short
Rises: 06:30 AM
Sets: 17:52 PM
Length: 11 hrs, 22 mins
Change: +3m 58s
I wrote this project to learn Go, so don’t expect anything too amazing. Feel free to raise issues.
The terminal UI library is lipgloss.
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠸⣷⣦⣀⠀⠀⠀⠀⠀⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣦⠀⠠⠾⠿⣿⣷⠀⠀⠀⠀⠀⣠⣤⣄⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠟⢉⣠⣤⣶⡆⠀⣠⣈⠀⢀⣠⣴⣿⣿⠋⠀⠀⠀⠀
⠀⢀⡀⢀⣀⣀⣠⣤⡄⢀⣀⡘⣿⣿⣿⣷⣼⣿⣿⣷⡄⠹⣿⡿⠁⠀⠀⠀⠀⠀
⠀⠀⠻⠿⢿⣿⣿⣿⠁⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣟⣁⠀⠋⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠈⠻⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢰⣄⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣠⡀⠀⣴⣿⣿⣿⣿⣿⣿⣿⡿⢿⡿⠀⣾⣿⣿⣿⣿⣶⡄⠀
⠀⠀⠀⠀⠀⢀⣾⣿⣷⡀⠻⣿⣿⡿⠻⣿⣿⣿⣿⠀⠀⠈⠉⠉⠉⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣠⣾⡿⠟⠉⠉⠀⢀⡉⠁⠀⠛⠛⢉⣠⣴⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠈⠉⠉⠀⠀⠀⠀⠀⢸⣿⣿⡿⠉⠀⠙⠿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣿⣿⠁⠀⠀⠀⠀⠀⠙⠿⣷⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀ ⠃⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.