Skip to main content

Timezones CLI

CLI toolkit for timezones:zap:

What can you do with timezones-cli? :sparkles:

  • 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.

Contents

Installation

  $ pip3 install timezones-cli

To run this CLI using Docker, check Run using Docker :whale:.

NOTE: List of country codes or timezone names :earth_asia:

Use -t flag to toggle 24 hours format.

Usage

Search for timezones

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
    
Demo demo of timezone cli search

Add/save timezones

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"
Demo demo of timezone cli add
---

Remove timezones

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"
Demo demo of timezone cli remove

Show saved timezones

$ tz show
Demo demo of timezone cli show
---

Select individual timezones from saved

$ tz select
Demo demo of timezone cli select

Get UTC time

Get UTC time based on current system time.

tz utc --help

$ tz utc

Get UTC time based on specified time and timezone.

$ tz utc <time> <timezone>

$ tz utc "11:45PM" "Asia/Kathmandu"
Demo demo of timezone cli select

Run using Docker :whale:

docker pull ghcr.io/yankeexe/timezones-cli:latest

Verify signature of the image: requires cosign.

COSIGN_EXPERIMENTAL=true cosign verify ghcr.io/yankeexe/timezones-cli:latest

Create 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 us

For 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 Nepal

For local debugging: Use the make run command followed by the command you want to run against the tz binary.

$ make run cmd="get ist"
Demo demo of timezone cli with Docker

Contributing

For guidance on setting up a development environment and how to make a contribution to timezones-cli, see the contributing guidelines.

Metadata

Release files for timezones-cli 0.3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for timezones-cli 0.3.8
File Interpreter ABI Platform
timezones_cli-0.3.8-py3-none-any.whl Python 3 none any Details

Release files / timezones_cli-0.3.8-py3-none-any.whl

Download URL timezones_cli-0.3.8-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b010b6f88792cf97a83269fa20923b4984f1c9476b6efa8c7587ad59579c5d6b
BLAKE2b-256 checksum
How to use checksums
1f9de8ba48847909dcfd1dcee5a95558b6af33147bf9067cd4144d99410a45ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.3.8 This release

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page