Socket
Socket
Sign inDemoInstall

timezonedb

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    timezonedb

timezonedb.com API [python wrapper]


Maintainers
1

Readme

timezonedb.com API [python wrapper]

Wrapper for timezonedb.com API

API Reference

Full timezonedb.com API reference can be found here

HOW TO USE

list timezone reference

List out all available time zones supported by TimeZoneDB.


from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.list_time_zone(response_format="json")
print(res)

get timezone reference

Get local time of a city by its name, time zone, latitude & longtiude, or IP address.


from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.get_time_zone(
    response_format="json",
    by="position",
    lat="40.689247",
    lng="-74.044502",
)
print(res)

from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.get_time_zone(
    response_format="json",
    by="city",
    city="chicago",
    country="US",
)
print(res)

convert timezones reference

Convert timestamp between two different time zone.


from timezonedb import TimezoneDBAPI

#get timezones
api = TimezoneDBAPI(api_key={TIMEZONEDB_API_KEY})
res = api.convert_time_zone(
    response_format="json",
    from_zone="America/Los_Angeles",
    to_zone="Australia/Sydney",
)
print(res)

Keywords

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