Skip to main content

Better Time

Better Time - is a Python library, converting string date expressions to seconds [int].

Installition

PyPI:

$ [py -m] pip install bettertime

GitHub:

$ git clone https://github.com/DarkJoij/bettertime

Examples

Converting from string expressions to seconds:

from bettertime import to_seconds

print(to_seconds('5hours 30minutes'))
19800

Converting from seconds to string expressions:

from bettertime import to_string

print(to_string(793800, language='en'))
9d 4h 30m
  • Function to_seconds take parameter expression: str.
  • Function to_string take 2 parameters: seconds: int, language: 'ru' | 'en' = 'ru'.

To see all dates aliases check file bettertime/parser.py.

Sweet using and building your lovely dsbots)

Release files for bettertime 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bettertime 1.0.0
File Size Uploaded
bettertime-1.0.0.tar.gz 4.2 kB Details

Release files / bettertime-1.0.0.tar.gz

Download URL bettertime-1.0.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
89e96d34a809c424f6feff1a8d74791ab79e6c08a6dba8a1faa125d3b866b8ad
BLAKE2b-256 checksum
How to use checksums
097154a711604727aab4a0d0803561ec37472cad4a116e54f3520869f26731b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page