Gets the timezone of any location in the world
Project description
Gets the timezone of any location in the world.
This uses google and caches the results so that you can hopefully stay outside the free rate limit (which I have no idea how high it is).
This is how you use it:
$ pip install whenareyou $ ipython In [1]: from whenareyou import whenareyou In [2]: tz = whenareyou('Hamburg') In [3]: tz Out[3]: <DstTzInfo 'Europe/Berlin' LMT+0:53:00 STD> In [4]: from datetime import datetime In [5]: tz.localize(datetime(2002, 10, 27, 6, 0, 0)) Out[5]: datetime.datetime(2002, 10, 27, 6, 0, tzinfo=<DstTzInfo 'Europe/Berlin' CET+1:00:00 STD>) In [6]: tz.localize(datetime(2002, 10, 27, 6, 0, 0)).isoformat() Out[6]: '2002-10-27T06:00:00+01:00'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
whenareyou-0.3.2.tar.gz
(445.1 kB
view hashes)
Built Distribution
whenareyou-0.3.2-py3-none-any.whl
(449.9 kB
view hashes)
Close
Hashes for whenareyou-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3d86c1cdf802cd5abe133da83b4dee5f81e61b9a90496bfe8ab4a73b501eac1 |
|
MD5 | 29568f1d0703dc4398c3d1804237e0e2 |
|
BLAKE2b-256 | 5964299432714207fb44d358950dc0fcd68df13f60c5c1bca84270fa49483538 |