tdfmt is a concise timedelta formatter
Project description
tdfmt
tdfmt is a concise timedelta formatter
from datetime import timedelta
from tdfmt import tdfmt
print(tdfmt(timedelta(hours=3, minutes=14, seconds=15, microseconds=926535))) # 3h14m15.926535s
print(tdfmt(timedelta(hours=4, minutes=20))) # 4h20m0s
print(tdfmt(timedelta(minutes=17, seconds=38))) # 17m38s
print(tdfmt(timedelta(seconds=9))) # 9s
print(tdfmt(timedelta(minutes=1, milliseconds=300))) # 1m0.3s
print(tdfmt(timedelta(microseconds=12340))) # 12.34ms
print(tdfmt(timedelta(microseconds=12))) # 12µs
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tdfmt-0.0.1-py3-none-any.whl
(3.2 kB
view details)
File details
Details for the file tdfmt-0.0.1-py3-none-any.whl.
File metadata
- Download URL: tdfmt-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdbffe9c54f3bb00643df695811fdf1ce11086479a673ae089e8709f15280e5b
|
|
| MD5 |
bfebeb8725b549b0d8a83c8a2694cffd
|
|
| BLAKE2b-256 |
ce2f20dc562aadbcdb296055b95d720b22a0a1d0600211b3decc0ebeaa530647
|