百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

daylight

> 编程语言
开源

一个用于跟踪日出和日落时间的命令行程序

367 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于跟踪日出和日落时间的命令行程序

daylight

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.

Installation

Homebrew (MacOS and Linux)

bash
# Add my tap (formula repository)
brew tap jbreckmckye/formulae
# Install daylight
brew install daylight
# Check it
daylight --help

You might need to run brew trust --formula jbreckmckye/formulae/daylight

Manual installation (and Windows)

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.

Usage

bash
# 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 --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

…

There is also a short summary mode

$ daylight --short
Rises:  05:41
Sets:   20:14
Length: 14 hrs, 32 mins
Change: +3m 39s

And 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"
}

Codebase

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· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gogolanglipglosssunrise-sunsetterminal

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言