Skip to main content

datetime.timedelta replacement

Project description

Install

$ [sudo] pip install timedelta

Classes

timedelta.Timedelta

datetime.timedelta replacement

timedelta.Total
method description
__init__(total_seconds) init from total seconds count
@property description
days return total days count
hours return total hours count
minutes return total minutes count
seconds return total seconds count

Examples

>>> import timedelta

>>> td = timedelta.Timedelta(days=2, hours=2)

# init from datetime.timedelta
>>> td = timedelta.Timedelta(datetime1 - datetime2)

total seconds, minutes, hours, days

>>> td = timedelta.Timedelta(days=2, hours=2)
>>> td.total.seconds
180000
>>> td.total.minutes
3000
>>> td.total.hours
50
>>> td.total.days
2

Links

readme-md - README.md generator

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

timedelta-2018.11.20.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

timedelta-2018.11.20-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 2 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