Files

38 lines
943 B
Org Mode
Raw Permalink Normal View History

2026-10-23 15:08:20 +00:00
* Sun
~sun~ wraps [[https://github.com/nathan-osman/go-sunrise][go-sunrise]] to calculate sunrise, sunset, and day length for a location.
** Usage
#+begin_src shell
sun -c LAT,LON [-d YYYY-MM-DD] [-z TIMEZONE] [-f FORMAT]
#+end_src
Flags:
- =-c= — coordinates as =latitude,longitude= (required)
- =-d= — date in =YYYY-MM-DD= format (default: today)
- =-z= — timezone (default: UTC)
- =-f= — output time format, [[https://pkg.go.dev/time#Time.Format][Go reference layout]] (e.g. =15:04= for HH:MM; default: RFC 3339)
The tool outputs three values: sunrise (time), sunset (time), and day length (duration).
** Examples
#+begin_src shell
$ 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
#+end_src
** Installation
#+begin_src shell
go install code.chimeric.al/dwrz/sun/cmd/sun@latest
#+end_src