Get local datetime from multiple timezones!
Project description
Timezones CLI
Get local datetime from multiple timezones.
All datetimes you care for, at a glance.
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 local date time
You can use short country code like 'AE', 'RU', 'US' and so on.
$ tz search "us"
$ tz search "Nepal"
Demo
Search based on timezone abbreviations
$ tz get "pst"
$ tz get "ist"
$ tz get "est"
$ tz get "cst"
Demo
Add 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
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
Show local datetime of all saved timezones
$ tz show
Demo
Select a single timezone from defaults
$ tz select
Demo
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
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
Contributing
For guidance on setting up a development environment and how to make a contribution to timezones-cli
, see the contributing guidelines.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for timezones_cli-0.2.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1230b960849e9a121603a4c4db21942b67402e62c049ae78fec6f76149c90c8e |
|
MD5 | 2916ea61bab17833241e4f1e9fb573c6 |
|
BLAKE2b-256 | 111dc2b5d36456c744b2a0470895fbefea643e543e0365f131deacb96697413e |