Skip to main content

Python package with convenience functions for dates, times, and intervals

Project description

datime

Python package with convenience functions for dates, times, and intervals

Usage

pretty_duration_short

Use the function pretty_duration_short to convert a whole number of seconds to a string that indicates the number of hours, minutes, and seconds in the provided duration.

>>> import datime
>>> datime.pretty_duration_short(59)
'59s'
>>> datime.pretty_duration_short(256)
'4m16s'
>>> datime.pretty_duration_short(60 * 60)
'1h0m0s'
>>> datime.pretty_duration_short(4096)
'1h8m16s'
>>> datime.pretty_duration_short(2**17)
'36h24m32s'

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

datime-2023.1.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

datime-2023.1-py3-none-any.whl (2.7 kB view hashes)

Uploaded Python 3

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