CLI toolkit for timezones:zap:
- Search for date and time based on city, country, or timezones.
- Manage dashboard for timezones you frequently view.
- Get UTC date and time based on your local timezone or any timezones.
$ pip3 install timezones-cliTo run this CLI using Docker, check Run using Docker π³.
NOTE: List of country codes or timezone names π
Use
-tflag to toggle 24 hours format.
Get time based on the entered timezone or country code
-
using country code (either 2 or 3 letters):
$ tz search US $ tz search USA
-
using timezone:
$ tz search Asia/Kathmandu
-
using fuzzy text: (example: Ireland)
$ tz search Irela
-
using timezone shortcodes (--zone or -z flag):
$ tz search pst -z $ tz search ist -z $ tz search jst -z $ tz search cest -z $ tz search +0543 -z $ tz search +05 -z
Timezones added to the config file are treated as the default timezones which is triggered by the tz show command.
file is stored at ~/.tz-cli
$ tz add "Asia/Kathmandu"There are two ways for removing timezones from the config file. Using the --interactive mode and passing the the --name flag.
$ tz remove -i
$ tz remove --name "Asia/Kathmandu"$ tz show$ tz selectGet UTC time based on current system time.
tz utc --help
$ tz utcGet UTC time based on specified time and timezone.
$ tz utc <time> <timezone>
$ tz utc "11:45PM" "Asia/Kathmandu"docker pull ghcr.io/yankeexe/timezones-cli:latestVerify signature of the image: requires cosign.
COSIGN_EXPERIMENTAL=true cosign verify ghcr.io/yankeexe/timezones-cli:latestCreate a config file manually first.
$ touch ~/.tz-cli
$ docker run --rm -it -v ${HOME}/.tz-cli:/home/tz/.tz-cli ghcr.io/yankeexe/timezones-cli search usFor convenience you can add alias of the command to your shell config:
$ echo "alias tz='docker run --rm -it -v ${HOME}/.tz-cli:/home/tz/.tz-cli ghcr.io/yankeexe/timezones-cli'" >> ~/.bashrc
$ source ~/.bashrc
$ echo "alias tz='docker run --rm -it -v ${HOME}/.tz-cli:/home/tz/.tz-cli ghcr.io/yankeexe/timezones-cli'" >> ~/.zshrc
$ source ~/.zshrc
# Use alias to invoke timezones-cli
$ tz search NepalFor local debugging: Use the make run command followed by the command you want to run against the tz binary.
$ make run cmd="get ist"For guidance on setting up a development environment and how to make a contribution to timezones-cli, see the contributing guidelines.








