Socket
Socket
Sign inDemoInstall

whenareyou

Package Overview
Dependencies
3
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    whenareyou

Gets the timezone of any location in the world


Maintainers
1

Readme

whenareyou

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'

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc