gotz - a simple CLI timezone info tool.
Directly via Go
go install github.com/merschformann/gotz@latest
Simply download the binary of the latest release (look for gotz_*_OS_ARCH
- darwin is macOS), unpack the gotz
binary and put it in a folder in your $PATH
.
brew tap merschformann/gotz # only once
brew install gotz
Show current time:
gotz
Show arbitrary time:
gotz 21
Show arbitrary time using different timezone (index based):
gotz 15@2
Time can be one of the following formats:
15
15:04
15:04:05
3:04pm
3:04:05pm
3pm
1504
150405
2006-01-02T15:04:05
Use live mode to continuously update the time (exit via q, esc or ctrl+c). Activate once via:
gotz --live true
(above also uses option --inline false
; for styling see customization below)
Set the timezones to be used by default:
gotz --timezones "Office:America/New_York,Home:Europe/Berlin"
(lookup timezones in the timezones wiki page - TZ identifier column)
Set 12-hour format:
gotz --hours12 true
The configuration is stored in $XDG_CONFIG_HOME/gotz/config.json
(usually ~/.config/gotz/config.json
on most systems). It can be configured directly or via the arguments of the gotz
command (see gotz --help
). The configuration attributes are described in the following example:
Working in an international team is a lot of fun, but comes with the challenge of having to deal with timezones. Since I am not good at computing them quickly in my head, I decided to write a simple CLI tool to help me out. I hope it can be useful for other people as well. Thanks for the inspiration @sebas!