View datetime in different time zones.
Project description
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
python3 -m tzview rst
would give
Extension: rst
--------------
reStructuredText
Used by: Docutils
Usage as module
The tzview()
function can be used. It accepts the extension name as string.
Return value would be a list of lists.
Each sub-list corresponds to an entry related to that extension.
It consists of two elements:
- The type of file which use the extension
- The kind of software capable of manipulating such a file
For example,
from tzview import tzview
info = tzview("py")
print(info)
would give
[['Python script file', 'Python interpreter']]
and
tzview("c")
returns
[['C source file', 'C compilers'], ['Unix file archive', 'COMPACT']]
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. :-)
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.