Skip to main content

tdfmt is a concise timedelta formatter

Project description

tdfmt

tdfmt is a concise timedelta formatter

Install

pip install tdfmt

Use

from datetime import timedelta
from tdfmt.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


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

If you're not sure about the file name format, learn more about wheel file names.

tdfmt-0.0.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file tdfmt-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tdfmt-0.0.3-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

Hashes for tdfmt-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0800eb3f709d579e5e71fc0a05ceb8194eb85385677ce9744916ba05f281a35e
MD5 62c1708a72bab19e1bf444ef2c8baca6
BLAKE2b-256 afb2c1fd77dfbf98d79f71c1f631f1cba02347c2e0eece76b87e3b513170b43d

See more details on using hashes here.

Supported by

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