/tz

🌐 A time zone helper

Primary LanguageGoGNU General Public License v3.0GPL-3.0

🌐 A time zone helper

tz helps you schedule things across time zones. It is an interactive TUI program that displays time across a few time zones of your choosing.

Usage

Simply run tz with no arguments to show the local time, as well as the UTC time zone. It gets more interesting when you pass a list of time zones to the program, as they are displayed below the current time zone.

For now, you need to select the time zones from the tz_data list, but I plan to make this friendlier for humans too.

If you would rather not type the list everytime, you could set an alias for your shell, or use the TZ_LIST environment variable with a semi-colon separated list of tz data zone names (see Configuration below). Command-line arguments trump the environment variable.

Check tz -h out for other flags.

The program will adjust to light and dark terminals themes.

Installing

If a build is provided for you architecture, you can directly grab a release, but no one will be harmed if you build from source, as only linux/amd64 builds are provided for now.

Packages

Brew

Brew has a tz package: brew install tz

Archlinux

If you're an Archlinux user, packages are also available:

  • tz follows releases and,
  • tz-git builds the main git branch.

Configuration

TZ uses standard time zones as described here. You can specify what time zones you want displayed by setting the TZ_LIST environment variable. Your local time will always be displayed. So, if you wanted to display local time + time in California, and Paris you would set your TZ_LIST to US/Pacific;Europe/Paris

Zone Alias

tz is configured only through TZ_LIST, and that limits us to the tz database names, but you can alias these names using a special value: the tz name followed by ; and your alias:

TZ_LIST="Europe/Paris,EMEA office;US/Central,US office"

Building

You need a recent-ish release of go with modules support:

git clone https://github.com/oz/tz
cd tz
go build

Testing

go test -cover

License

The GPL3 license.

Copyright (c) 2021 Arnaud Berthomier