trunk
Sun
sun wraps go-sunrise to calculate sunrise, sunset, and day length for a location.
Usage
sun -c LAT,LON [-d YYYY-MM-DD] [-z TIMEZONE] [-f FORMAT]
Flags:
-c— coordinates aslatitude,longitude(required)-d— date inYYYY-MM-DDformat (default: today)-z— timezone (default: UTC)-f— output time format, Go reference layout (e.g.15:04for HH:MM; default: RFC 3339)
The tool outputs three values: sunrise (time), sunset (time), and day length (duration).
Examples
$ sun -c 51.4769,0.0005
2026-10-23T06:37:08Z 2026-10-23T16:51:16Z 10h14m8s
$ sun -c -77.8419,166.6863 \
-d 2026-03-20 \
-z Antarctica/McMurdo \
-f "15:04"
07:38 20:23 12h45m28s
Installation
go install code.chimeric.al/dwrz/sun/cmd/sun@latest
Languages
Go
65.1%
Makefile
34.9%