Skip to main content

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.1.0.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

whenareyou-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file whenareyou-0.1.0.tar.gz.

File metadata

  • Download URL: whenareyou-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for whenareyou-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7d11c5c0c38f814c93dc5244b58b34780dd8821153ade0ef12298f4abe95e4f0
MD5 e1deb0ca2f21cfeffeb8eed6b96b6ebf
BLAKE2b-256 705c064d861362528a3d8898bb4cc834b5e180d2677d8475f231e1632bec9e5d

See more details on using hashes here.

Provenance

File details

Details for the file whenareyou-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for whenareyou-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a328e350186e06c0aad70d16a348ae05b1ae01f8f1447faa836c4f1beb6d3e1
MD5 685f40b523da57560a5d647a0f78de5f
BLAKE2b-256 289077f4a6aa593f5ec6e391bd162440f36b309131b460a1280396360a46f170

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page