Skip to main content

Library converting string date expressions to seconds [int].

Project description

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)

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

bettertime-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file bettertime-1.0.0.tar.gz.

File metadata

  • Download URL: bettertime-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.2

File hashes

Hashes for bettertime-1.0.0.tar.gz
Algorithm Hash digest
SHA256 89e96d34a809c424f6feff1a8d74791ab79e6c08a6dba8a1faa125d3b866b8ad
MD5 8b7ea2e782d08050bc5edddc98141b0f
BLAKE2b-256 097154a711604727aab4a0d0803561ec37472cad4a116e54f3520869f26731b6

See more details on using hashes here.

Supported by

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