Skip to main content

A Python library to get relative datetime strings and parse datetime strings.

Project description

relative-datetime

A Python library to get relative datetime strings and parse datetime strings.

Installation

pip install relative-datetime

Usage

from relative_datetime import DateTimeUtils

# Example usage
input_datetime = datetime(2023, 6, 1, tzinfo=pytz.utc)
relative_time, direction = DateTimeUtils.relative_datetime(input_datetime)
print(f"Relative time: {relative_time}, Direction: {direction}")

datetime_string = "2023-06-01T12:34:56Z"
parsed_datetime = DateTimeUtils.parse_datetime(datetime_string)
print(f"Parsed datetime: {parsed_datetime}")

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

relative_datetime-0.1.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

relative_datetime-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relative_datetime-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.4

File hashes

Hashes for relative_datetime-0.1.0.tar.gz
Algorithm Hash digest
SHA256 27b77e0a5eafd8fcafb1893efc4b2bcda0bae519f5cd48faf90c3636377254d6
MD5 2818d3cf8c4501af655a26329e5bafa9
BLAKE2b-256 d12ff2b3ef1c3eae8249b21beba07f846f6c0f718ab2a30cbf7a303f78a47ebd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for relative_datetime-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0423e0d93a97e4a77641388da2556456adb1940966d56fdeb4111d068fcf43e5
MD5 1ce7eb94f026ec9c71c0c98a86934779
BLAKE2b-256 bd4b6ef8fd0cd4a943b8d83a8ef6c2298960e8aa9bc547f9a8547d59cb151b9f

See more details on using hashes here.

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