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
Release history Release notifications | RSS feed
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)