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 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.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tdfmt-0.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a43b8ec259d2c8eae8be266b638f80cf3059827d0674f6cd861fb7c4fcef3a1
MD5 96428a7eb21e1ac3504f9597ed64a10d
BLAKE2b-256 7dc56fd05494038154ae76ba7b600280d52179982ad23c48e19384e0e2d072a6

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