Socket
Socket
Sign inDemoInstall

timezone-tools

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timezone-tools

Tools for working with timezone-aware datetimes.


Maintainers
1

timezone-tools

Helpers for working with timezone-aware date-times.

This package provides:

  • TimezoneConverter for making date-times timezone-aware and converting between timezones.
  • Clock for getting the current time/date in a specific timezone.

TimezoneConverter

This converter object can be used to create timezone-aware datetime objects, to make a naive datetime timezone-aware, and to localize other timezone-aware datetime objects.

The converter also provides utilities for converting a datetime into a date in the converter's timezone, calculating dates and time relative to a datetime, and rounding a datetime to the nearest increment of time (e.g. to the nearest half-hour).

Create an instance of the timezone converter by passing it an IANA time zone name.

from timezone_tools import TimezoneConverter

paris_time = TimezoneConverter("Europe/Paris")

For more information about timezone support in Python, see the documentation for the zoneinfo module.

Clock

This clock object can be used to access the system clock and provides timezone-aware dates and times.

The clock also provides utilities for calculating dates and time relative to the current moment.

Create an instance of the clock by passing it an IANA time zone name.

from timezone_tools import Clock

paris_time = Clock("Europe/Paris")

For more information about timezone support in Python, see the documentation for the zoneinfo module.

FAQs


Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc