tzview
View datetime in different time zones.
Given a time zone and datetime, tzview can find the datetime at other time zones.
The time zone names are those as specified in the Olsen time zone database (tz).
tzview merely leverages pytz package to get the job done.
Installation
You need Python>=3.6 to use tzview.
It can be installed from PyPI with pip using
pip install tzview
Usage
Defaults
The string 'local' can be used to specify the local time zone. This is the source time zone by default.
The string 'now' can be used to specify the local datetime. This is the source datetime by default.
Command line usage
To get the current time at Tokyo relative to your computer's current time and time zone, use
python3 -m tzview Asia/Tokyo
to get something like
2020-05-24 09:16:05.281238+09:00 : Asia/Tokyo
You could provide source datetime using --dt option and source time zone with --from-tz option. Like
python3 -m tzview --dt "2020-03-23 11:32:34" --from-tz Asia/Tokyo Europe/Oslo Asia/Istanbul
to get an output like
2020-03-23 03:32:34+01:00 : Europe/Oslo
2020-03-23 05:32:34+03:00 : Asia/Istanbul
Use python3 -m tzview --help for more.
Usage as module
The tzview() function can be used. It accepts the extension name as string.
Return value would be a list of timezone aware datetimes.
For example,
>>> from tzview import tzview
>>> t(['Europe/Oslo'])
[datetime.datetime(2020, 5, 24, 12, 6, 14, 272335, tzinfo=<DstTzInfo 'Europe/Oslo' CEST+2:00:00 DST>)]
>>> t(['Europe/Athens', 'Asia/Singapore'])
[datetime.datetime(2020, 5, 24, 13, 11, 7, 32042, tzinfo=<DstTzInfo 'Europe/Athens' EEST+3:00:00 DST>), datetime.datetime(2020, 5, 24, 18, 11, 7, 32042, tzinfo=<DstTzInfo 'Asia/Singapore' +08+8:00:00 STD>)]
Why
It is useful to figure meeting times when you got to attend meeting at a different time zone.
Or when calling a friend at another timezone to figure out the time of the day there.
That's what I use it for. :-)
Metadata
Release files for tzview 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tzview-0.3.tar.gz | 4.2 kB | Without provenance | Details for tzview-0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tzview-0.3-py3-none-any.whl | Python 3 | none | any | Details for tzview-0.3-py3-none-any.whl |
Total release size: 9.5 kB
Release files / tzview-0.3.tar.gz
| Download URL | tzview-0.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb65ae6f035371beefa2212d12183b868c13c216181992398c67181ec2a14226
|
|
BLAKE2b-256 checksum How to use checksums |
60439f0d10d7014fe9bc0d2fe22167cd3d0f5a5280a9d8953141d4583b4b6158
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
|
Release files / tzview-0.3-py3-none-any.whl
| Download URL | tzview-0.3-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f39705e237c43283e0f472bed2428ae7b9de4d28f7f1aba8904eb794cd79c3ab
|
|
BLAKE2b-256 checksum How to use checksums |
e76561e7c3db081cf4ece40fcc023430c6b2ef00bf774ec4551a59c39083c187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
|
Security for tzview 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.