Skip to main content

Tools for working with timezone-aware datetimes.

Project description

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.

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

timezone_tools-0.1.0.post1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timezone_tools-0.1.0.post1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file timezone_tools-0.1.0.post1.tar.gz.

File metadata

  • Download URL: timezone_tools-0.1.0.post1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for timezone_tools-0.1.0.post1.tar.gz
Algorithm Hash digest
SHA256 c3545d179ee59f49764810878ea178433519974cc8c112a187e6d9416b289130
MD5 73068bd5c453488f649dc13c219a1d0e
BLAKE2b-256 821dcb95e07ac2e5c736736dbba5a4b76f9872b535013205770b8ef3e4f27ce5

See more details on using hashes here.

Provenance

The following attestation bundles were made for timezone_tools-0.1.0.post1.tar.gz:

Publisher: build_and_publish.yaml on kraken-tech/timezone-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file timezone_tools-0.1.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for timezone_tools-0.1.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 536fcae45029358d7fa5379d527856c0e34afb855de9ea8629326f60f9c5d6aa
MD5 5895e7e0ed2ee47a6c283f163220f049
BLAKE2b-256 a21f01f16a533a15c7e4e61984fd8929c038cc61851ca3d3de30c67cdd1462a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for timezone_tools-0.1.0.post1-py3-none-any.whl:

Publisher: build_and_publish.yaml on kraken-tech/timezone-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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